how to make a constant and use globally?

Report
Question
677 views

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');

Please explain why do you think this question should be reported?

Report Cancel

return [
   'ADMINEMAIL' => 'info@bestinterviewquestion.com',
];
Now we can display with
Config::get('constants.ADMINEMAIL');

Thread Reply

Leave an comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>