Loading…

How to make a constant and use globally?

You can create a constants.php page in config folder if does not exist. Now you can put constant variable with value here and can use with Config::get('constants.VaribleName');

Example

                                        
return [
    'ADMINEMAIL' => 'info@bestinterviewquestion.com',
];

Now we can display with

Config::get('constants.ADMINEMAIL');

Suggest An Answer

No suggestions avaliable!

Latest post from Laravel Interview Questions

Ask Question