Answers for "laravel get config variable"

PHP
1

laravel set config

config()->set('config.path', $value);
Posted by: Guest on January-08-2021
0

url() inside laravel config files

Configs are loaded really early and probably not meant to use anything from the framework except Dotenv

return [
    'photos_url' => URL::asset('xxx'),
];

Instead you can use:

return [
    'photos_url' => env('APP_URL').'/rest_of_path.ext',
];
Posted by: Guest on September-11-2020

Browse Popular Code Answers by Language