You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-3
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ We include various service providers for the most common package needs. So you c
72
72
73
73
If you want to register package configuration you have to extend the `ConfigurationServiceProvider`.
74
74
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
+
75
77
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:
76
78
77
79
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.)`.
84
86
85
87
For providing routes you have to extend the `RouteServiceProvider`.
86
88
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
+
87
91
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, ...).
88
92
89
93
#### Views / Templates
90
94
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.
92
100
93
101
#### Database Migrations
94
102
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.
96
108
97
109
#### Translations
98
110
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.
100
116
101
117
For the new implemented way for json files we also support the `$useJson` flag. When `true` the given files have to be json format.
0 commit comments