Skip to content

Commit 9a281ce

Browse files
author
Robert Kummer
committed
support package path by documenting
1 parent 635cebd commit 9a281ce

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ We include various service providers for the most common package needs. So you c
7272

7373
If you want to register package configuration you have to extend the `ConfigurationServiceProvider`.
7474

75+
First of all, please add a protected `$packagePath` to your extended service provider class and give it a value for the package root folder like so: `protected $packagePath = __DIR__ . '/../../';`. This is necessary to mark your files relative to the package root.
76+
7577
You have to add your configuration files in attribute `$configurationFiles`. File by file as array item. If you want to give an alias for config you have to set is array key. For example:
7678

7779
Within your package you have a `config/config.php` and you want to have it published and merged as `my-package` you have to set it like so
@@ -84,19 +86,33 @@ Then you can get config values by using `config('my-package.)`.
8486

8587
For providing routes you have to extend the `RouteServiceProvider`.
8688

89+
First of all, please add a protected `$packagePath` to your extended service provider class and give it a value for the package root folder like so: `protected $packagePath = __DIR__ . '/../../';`. This is necessary to mark your files relative to the package root.
90+
8791
Just set `$routesNamespace`, `$routesMiddleware` and `$routesFile` to your needs and you are ready to go. For registering various routes you should have one provider for each type of routes file (api, web, ...).
8892

8993
#### Views / Templates
9094

91-
We provide the `ViewServiceProvider` for extension. You have to set the `$namespace` to your package based identifier. The `$templatesFolder` is set to the `resources/views` by default, you can override it.
95+
We provide the `ViewServiceProvider` for extension.
96+
97+
First of all, please add a protected `$packagePath` to your extended service provider class and give it a value for the package root folder like so: `protected $packagePath = __DIR__ . '/../../';`. This is necessary to mark your files relative to the package root.
98+
99+
You have to set the `$namespace` to your package based identifier. The `$templatesFolder` is set to the `resources/views` by default, you can override it.
92100

93101
#### Database Migrations
94102

95-
We provide the `MigrationServiceProvider` to provide database migration files from package. You have to set the `$migrationsFolder` to your package migrations.
103+
We provide the `MigrationServiceProvider` to provide database migration files from package.
104+
105+
First of all, please add a protected `$packagePath` to your extended service provider class and give it a value for the package root folder like so: `protected $packagePath = __DIR__ . '/../../';`. This is necessary to mark your files relative to the package root.
106+
107+
You have to set the `$migrationsFolder` to your package migrations.
96108

97109
#### Translations
98110

99-
We provide the `TranslationServiceProvider` for extension. You have to set the `$namespace` to your package based identifier. The `$translationsFolder` is set to the `resources/lang` by default, you can override it.
111+
We provide the `TranslationServiceProvider` for extension.
112+
113+
First of all, please add a protected `$packagePath` to your extended service provider class and give it a value for the package root folder like so: `protected $packagePath = __DIR__ . '/../../';`. This is necessary to mark your files relative to the package root.
114+
115+
You have to set the `$namespace` to your package based identifier. The `$translationsFolder` is set to the `resources/lang` by default, you can override it.
100116

101117
For the new implemented way for json files we also support the `$useJson` flag. When `true` the given files have to be json format.
102118

0 commit comments

Comments
 (0)