samedi 29 avril 2023

How handle a global variable which has changable value in laravel

Suppose we have a variable which must be accessible from all over the laravel app. This variable can be changed by end user.

First I thought it can be defined as a key in one of config files in config directory of laravel and whenever the user change the value of this variable, we can use config::set helper somehow to update the value of this variable in config file.

But the problem is that all config files will be cached in laravel and config::set does not do the job.

I prefer to not use database storage approach.

Any suggestion for solving such a problem?

Thanks in advance,



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire