I have developed multiauth system with laravel . And I have implemented middleware on routes.
auth
is for admin and auth:customer
for customer login. i have implemented these middlewares on routes. so now what I want is on customer route if customer is is not logged in it should redirect on customer login but currently it is redirecting on admin login.
customer routes
Route::group(['middleware' => ['auth:customer']], function () {
Route::get('/customer-read-notification', function () {
Auth::guard('customer')->user()->unreadNotifications->markAsRead();
return 1;
});
});
admin routes
Route::group(['middleware' => ['auth']], function () {
Route::get('/staff-read-notification', function () {
Auth::user()->unreadNotifications->markAsRead();
return 1;
});
});
question from:
https://stackoverflow.com/questions/65860216/how-to-redirect-to-customer-login-page-in-laravel 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…