Here, you can learn how to get or set configuration variables value in laravel 5 application. There two way to get and set config variable value. You can simply use config helper of laravel or config facade.
Sometimes, It is very important to get some configuration variable value like Domain URL, timezone, email title etc. PHP Laravel framework provide us very simple and easy way to get and set config variable value.
In this article you can see how we can get value of configuration variable:
Get Config Variable Value:
$url = config('app.url');
OR
$url = Config::get('app.url');
Set Config Variable Value:
$url = config('app.url','http://hdtuto.com/');
OR
$url = Config::set('app.url','http://hdtuto.com/');
You can simple try with this!
Do you like below Tutorials ?
- PHP Laravel 5.5 - import export data into excel and csv using maatwebsite
- Laravel 7.x and 6.x create custom facade example from scratch
- Node JS - Get Real time online users counter using socket io example
- PHP Laravel 7.x and 6.x - Bootstrap Admin Theme Integration example from scratch
- MySQL Query - How to select records of today to next Sunday ?
- Laravel 7.x and 6.x - username custom validation example
- Laravel 5.5 - Import Extract zip file using chumper/zipper package
- PHP Laravel Set Custom Validation Error Messages Example