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;
});
});
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3iDHhbm
via IFTTT
Aucun commentaire:
Enregistrer un commentaire