Skip to content

Commit fc65765

Browse files
committed
Doc to disable auto-loader on prod
1 parent 108de2b commit fc65765

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,35 @@ LLH is a set of artisan commands to manage translations in your Laravel project.
4646
```
4747

4848
- Update your installation : `composer update`
49-
- For Laravel, add the following line in the `providers` array of the `config/app.php` configuration file :
49+
50+
- For Laravel, add the following lines in the `AppServiceProvider` array of the `config/app.php` configuration file :
5051
```php
5152
Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProvider::class,
5253
```
5354

55+
On Laravel 5.5, if you don't use the package in production, disable auto-loading and register it only on `local` or `dev`:
56+
57+
- Add the following lines in the `register` method of the `AppServiceProvider` :
58+
```php
59+
public function register()
60+
{
61+
if ($this->app->environment() === 'dev') { // or local or whatever
62+
$this->app->register(\Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProvider::class);
63+
}
64+
}
65+
```
66+
67+
- Disable to auto-register provider by adding these lines in the `composer.json` file:
68+
```php
69+
"extra" : {
70+
"laravel" : {
71+
"dont-discover" : [
72+
"potsky/laravel-localization-helpers"
73+
]
74+
}
75+
}
76+
```
77+
5478
- For Lumen, add the following lines in the `bootstrap/app.php` file :
5579
```php
5680
$app->register( Potsky\LaravelLocalizationHelpers\LaravelLocalizationHelpersServiceProvider::class );

0 commit comments

Comments
 (0)