How to define Global Variables in Laravel?
ReportQuestion
3 years ago 777 views
First we have to create global.php file in config folder of your laravel application. I did add three variable in that file : siteTitle, pagination and tagLine. We can get global variable value on controller, view, model and anywhere.
//config/global.php
return [
'siteTitle' => 'HD Site',
'pagination' => 5,
'tagLine' => 'Do the best'
];
//any controller,view,model
{{ config('global.siteTitle') }}
Thread Reply