Laravel get and set config variables value example

April 22, 2017 | Category : Laravel 5.5 Laravel 5 Laravel PHP

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!