How to set .env values in laravel programmatically on the fly

前端 未结 14 1020
忘掉有多难
忘掉有多难 2020-12-01 09:05

I have a custom CMS that I am writing from scratch in Laravel and want to set env values i.e. database details, mailer details, general configuration, etc from

14条回答
  •  忘掉有多难
    2020-12-01 09:37

    you can use this package https://github.com/ImLiam/laravel-env-set-command

    then use Artisan Facade to call artisan commands ex:

    Artisan::call('php artisan env:set app_name Example')
    

提交回复
热议问题