Answer the question
In order to leave comments, you need to log in
Where is the best place to store information in Laravel?
Hello. I need your help, I'm making a website for the Minecraft game project. The task is such, after successful authorization, a person needs to make a choice on which server he plays, and information about which server we need to pull up. In general, his choice needs to be saved somewhere before he leaves the site, and I don’t know where I can do it better .. tell me please) Is it
better to store in cookies, if so, how is it better? Or store it in the session, or if possible somehow, then write the Auth::user() object to the object, such as auth()->user()->server
Answer the question
In order to leave comments, you need to log in
In session.
You can also store in cookies. Everything depends on the task.
You can store in many places. Depends on how critical the loss of this value will be. Cookies, Local Storage and sessions don't last forever, the most reliable thing in a database. Create a server column and go:
$user = Auth::user();
$user->server = "127.0.0.1";
$user->save();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question