I have the next problem: After auth user with Auth Passport provider in Laravel I get Auth::user()
. Then I try to append variable to it.
$role = Input::get('role');
$user = Auth::user();
$user->role = $role;
Auth::setUser($user);`
It works well if use a new $user
variable in current controller and route, but if I try to get Auth::user()
in another route it returns old values.
How to append variable to Auth::user()
and then save it and cache it?
I want to change Auth::user()
with "setUser" method and then cache it for use on all other routes. How can I solve my problem?