Laravel | How to Define Global Config Variables #Laravel #Laravelphp

preview_player
Показать описание
In this video, I explained that how you can define and access global config variables. Global config helps you to define once and access everywhere, also it keeps code clean.

-----------------------------------------------------------------------------------
How to define global config variables in Laravel
-----------------------------------------------------------------------------------
00 - Method 1: By Creating a Config file
3:27 - Method 2: By Defining Variable in App Service Provider
5:09 - Method 3: App Singleton Method
6:42 - Method 4: Config Set at Run Time
8:26 - Method 5: Share Variable in Specific Views
Рекомендации по теме
Комментарии
Автор

I am using App service provider view::share approach how do I update value that I set in App service provider from controller and from view??

AbdulRehman-ltgm
Автор

my scene is I am using global variable as status and its value = 0 and I want if someone do something like click on some button its values update from 0 to 1 so that I can use this global variable as flag

AbdulRehman-ltgm
Автор

How can we declare a global variable that can change dynamically

rajeshdehury
join shbcf.ru