try with dump() instead of dd. with dd you break the request cycle and I think this stops the session being saved (or something like that)
Jul 28, 2017
7
Level 5
How to genearte session using Auth::loginUsingId(); ?
after using Auth::loginUsingId(); how to use another route with same user details ? EX :
Route::get('a',function(){
$user = Auth::loginUsingId(1, true);
dd($user);
});
Route::get('b',function(){
$user = Auth::user();
dd($user);
});
after a route when i check b route $user is null ????
Level 122
sorry for all the questions but your code is fine. The only thing I would change is to just return $user at the end of each test.
are you running route a and route b in the same browser tab?
1 like
Please or to participate in this conversation.