I need to declare a globlal variable, something similar to:
$user = Auth::user();
I am consuming an API and I need to get the $user
variable in the login form in a global way to use it in the whole app. I am not very familiar with this topic as I saw something done as Laravel/passport
, but I do not know if there is another method to achieve it.
In short, what I need is: When logging in, use the return variable $user
globally.
How can I do it?