Created
June 20, 2020 14:47
-
-
Save skadimoolam/c35c461cb11a44b0b806e832efd6b8d4 to your computer and use it in GitHub Desktop.
A simple way to write new Laravel config file dynamically | More info at https://simplestweb.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rawSettings = json_decode($request->get('settings'), true); | |
if ($rawSettings == null) abort(500); | |
config(['settings' => $rawSettings]); | |
$text = '<?php return ' . var_export(config('settings'), true) . ';'; | |
file_put_contents(config_path('settings.php'), $text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment