Please be more specific. Most packages are loaded via composer so your development packages would be in the require-dev block. If your talking about credentials then you need to put them in the .env file (renamed from .env.example).
In Laravel 4.2 my app/config/local/app.php file looks like this
return [
'providers' => append_config([
'Way\Generators\GeneratorsServiceProvider'
])
];
and my composer.json has the require-dev dependency:
"way/generators": "1.*"
This way, I can load the GeneratorsServiceProvider only on local development environment
I was wondering how can I achieve the same thing in Laravel 5.
Thanks!
While I've never returned the providers array from app.php, that specific file in L4 was an environment file for your "local" environment. There are no environment sub-folders in L5 only the .env file (renamed from .env.example). Another user posted this same question in the Laracasts forum. https://laracasts.com/discuss/channels/general-discussion/l5-append-config-problem
I'm not sure why this needs to be done as your development dependencies/packages will only install and load if you are in your development environment.
cringer said:
I'm not sure why this needs to be done as your development dependencies/packages will only install and load if you are in your development environment.
Imagine that you installed way/generators as a require-dev dependency and then registered that service provider in the app.php file. Everything would work fine until you deployed then composer wouldn't install way/generators laravel would throw a error when it tried to load that service provider
You could add a new ServiceProvider that you register in your app.php and as part of that you could possibly then detect the environment, and register additional providers and facades in the boot/register method in that service provider.
As @Kussie said, but with link: https://laracasts.com/discuss/channels/general-discussion/l5-append-config-problem
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community