Answer the question
In order to leave comments, you need to log in
Why doesn't laravel redirect after logging in?
Hello.
Made "custom" authorization, according to the Laravel documentation (version 5.4)
public function authenticate(Request $request)
{
if (Auth::attempt(['email' => $request->login, 'password' => $request->password]) || Auth::attempt(['phone' => $request->login, 'password' => $request->password])) {
return redirect()->intended('/home');
}
else {
return redirect()->intended('/login');
}
}
Route::get('/', function () {
return redirect('/login');
});
Auth::routes();
Route::get('/logout', 'Auth\[email protected]');
Route::post('/sendCode', 'SmsCode\[email protected]');
Route::post('/verifCode', 'SmsCode\[email protected]');
Route::get('/home', '[email protected]')->name('home');
Route::get('/cabinet', '[email protected]')->name('chat');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question