Thursday, July 18

Tag: laravel guards

Web Tricks

How to implement multiple user authentications using Laravel Guards

Introduction As developers, there are couple of times where your application will require different type of users. Take for instance you're building a Hospital Management software and you need both Doctors and Patients to be entirely unique users. How do you handle registration and authentication for both users in such a scenario? Laravel makes it easy to authenticate against multiple user models by using guards and providers.   Guards and Providers Before we dive into building our app, let's understand the concepts behind Guards and Providers which are essentially the building blocks of implementing multiple user authentication in Laravel. What are Guards? Guards can be seen as a way of identifying authenticated users. Laravel ships with two default guards - weband apiwith pr...