Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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',
];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #config #files
ADD COMMENT
Topic
Name
5+7 =