How to Set Config File Value in Laravel?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today now in this post i will talk about How to Set Config File Value in Laravel? sometimes we need to get the configuration files value then we can set by using config helper in Laravel application. Now in my previous post i was added how to get the config file value in laravel. If we are working on Laravel application then we should use Config facade for get and also set the value of config file. Maybe sometimes we need to set application url from app.php file or database name from database.php file so we can set this by that way:

Example:
config()->set('app.url','http://localhost:8000');
OR
Config::set('app.url','http://localhost:8001');

Read Also : Laravel 8 Mobile Number Verification Tutorial

Thanks for read. I hope it help you. For more you can follow us on facebook

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →