Multiple Authentication in Laravel (Admins + User) Part - 2

preview_player
Показать описание
The previous video we set up multiple authentication guards and multiple authentication models natively in Laravel . Everything works well and our middleware is already protecting our pages. But now we need to let users log in. We already have access to the normal user's login page. But the problem is we don't have a way to let our Admins log in.

In this video I will show you how to create a LoginController for our Admins to manage their login functionality. We are also going to make a login form, by simply duplicating the form that Users already have, but for your app you might want to make a custom login form for each user and you can do that here in your views.

One challenging part might be how to log the user in. In this section of the controller we use the Auth::attempt function to log the user in using the native Laravel Auth facade.

==== QUESTIONS? ====

Leave a comment below and I or someone else can help you.

Thanks for all your support!
Рекомендации по теме
Комментарии
Автор

You are creating a video on newyear eve is a very big thing.

vaibhavkanmeriya
Автор

Hello Bro! Good video, I have a problem with this tutorial, it followed everything you said and when I logged in as admin it redirects me to the same login :(

albagestifernandez
Автор

hello bro i have error: Class does not exist
but i have the class at the right place and i did the same as u

if u have any idea whats the problem might be
help me pls and thx

abdelhalim
Автор

Works like a charm. Thank you so much! I'm definitely subscribing.

s_mai
Автор

May I know, what is the admin.dashboard in your web.php route?

where is the admin.dashboard? I'm confused how to use the route grouping

s_mai
Автор

Method does not exist. what is the solution? I have used laravel 7

gauraventerprises
Автор

Why am I logging out users, the admin is also logging out ?

minerf
Автор

thaks but i have one question, i want to register admin not by tinker but by page register
?

Cats_lover
Автор

Subscribed!! Good tutorial, , can you make user approval after registration please? So the new user only able to login, but he can't access anything because his account is not approved by administrator

RobbyAJM
Автор

it says Undefined index: password. what might be the solution

callmehurt