authentification not working in laravel 5.4

Posted 2 years ago by Laravelchik

In RegisterController I wrote $user=User::create([ ... ]); Auth::login($user); $myid = Auth::id(); return redirect()->route('profile',['id'=>$myid]),

And I redirect to page with new id.

In web.php I wrote Route::get('/profile/{id}','[email protected]')->name('profile');

But in ProfileController show I wrote dump(Auth::user()) and it shows 'null' I tried with sessions. But session are not saving and it also shows 'null'. I tried to change Kernel.php but it didnt help. I tried all routes move to middleware web although Laravel automatically uses this middleware. Of course, it also didnt help. I have this problem.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.