I have an API with laravel 5.6 and I need to create global variables that throughout the application can have their value changed, however I'm having problems.
Example: 1. At the first request, the value of this variable is "test"; 2. In the second request I want to get the current value, which should be "test";
The value of the variable is only valid during the execution of the request, ie, I make a request to the controller aaaControler, this makes use of other controllers, within the same request the value persists, but ends in the return. >
I thought of persisting in the database, creating a reference and always fetching this value there, but will this be the best way?
I ask for help with this question.
Thank you.