(Part 2) Logging In Multiple Users – Native Multi Auth in Laravel 5.4


The previous video we set up multiple authentication guards and multiple authentication models natively in Laravel 5.4. 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.

For the most part this video will be pretty straightforward for advanced Laravel devs. I recommend skipping this video if you don’t feel like you need it.

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.

If you have any questions, leave a comment below.

—— WRITTEN TUTORIAL: (Coming Soon)

=== Multiple Authentication in Laravel 5.4 Series: ===
Part 1: Setting up our Models and Auth Guards

Part 2: Creating Login Pages and Logging in Users

(Current Video)

Part 3: Modifying Middleware to Support Multiple Users

Part 4: Forgot My Password Functionality across Multiple User Types
Coming Soon.


Download from GitHub:

==== FOLLOW ME ====

Subscribe to DevMarketer Insider

Twitter – http://twitter.com/_jacurtis
(ask me questions!)

==== QUESTIONS? ====

Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.

Email me hello@jacurtis.com

Thanks for all your support!

Laravel 5.4 Authentication Multiple User Models One Application. Best tutorial authentication laravel help. Laravel 5.3 Muliple Authentication. No Packages. Laravel Php code tutorial video post example. Store user admins. Multiauth tutorial. Login form. Login function. Auth facade. Auth attempt laravel function.


Copied title and URL