gsmart07's avatar

Wanted to move away values from .env

I have a situation where client wants me to not expose credentials of database by not putting directly into .env file but in external file in another directory on server, which loads those values and will work and I will also able to share my code easily. I did this in Codeigniter and CakePHP where config files are usually php files but seems to be difficult in Laravel, Please help.

0 likes
2 replies
robrogers3's avatar

try this:

in the AppServiceProvider update the boot method.

public function boot() { // alter .env path app()->useEnvironmentPath(base_path('..')); //or wherever }

1 like

Please or to participate in this conversation.