dimanche 23 décembre 2018

Laravel 5.4 environment based config files

I am trying to change the Laravel config file, based on environment, but I do not know how.

Code to get config is

Config::get( 'contants.api_url' );

I am trying to have a separate results for the live environment and the development environment, so in LIVE,

I need to override some config files, so everybody who is using the development environment, has the same base configuration. I cannot use the .env file for this, because it is not shared between the team and everybody has their own version of it.

The LIVE server configuration has to differ from the development files.

What did I try:

I read here Laravel 5 configuration - environments and overriding that you can create subfolders within your /config folder, that match the environment, to override the default config files. Alas it did not work for me and the Laravel 5.4 documentation on the subject matter (https://laravel.com/docs/5.4/configuration#retrieving-environment-configuration) did not speaks about this option, thus I believe it might have been deprecated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire