Guards define how the application retrieves and sends information about the user; whether it’d be by the class method of cookies or api tokens. Guards are slightly more technical but using guards allows us to have multiple authentication. So imagine we have a web app with a customer and an admin. At first thought we could customise the users table to have a column labelled ‘Admin’ and with that we can check whether or not a user is an admin and perform the necessary redirects.
This is where things get cool and organised. Guards allows the developer to create a separate table for Admins and with that table we can use guards to tell the web app to authenticate the user against the Admin table data.
So instead of clumping our users and admins in a large data set, we’re able to separate the user type not by a column but by a brand new table.
In Laravel the way it works is we define a guard, the guard uses the provider and the provider tells the app which table to retrieve and authenticate the user.
For a full example of a multiple authentication using laravel guard see -