You can put that in session in laravel as well. Or alternatively, if you want them to be persisted for long-long time, use cookies. So that visitor, might not have to set them for every session.
Apr 26, 2016
5
Level 21
Whats the equivalent of old school Globals in L5?
I'm building a basic ecommerce site and I need to remember the visitors currency preference.
(Assuming there is are no user accounts) what the best was to handle this in L5?
In the old days I would have just set a session variable but normal searches on here and google are leading me in wild directions.
Level 80
@sunscreem There’s nothing wrong with setting a preference like this in the session:
Session::put('preferred_currency', 'GBP');
“Old-school globals” wouldn’t be applicable as their value would be lost between HTTP requests.
Please or to participate in this conversation.