Laravel Auth Process

Purpose

Create different authentication for both user and admins using Laravel’s default auth process.

Config

  • Create a guard “admin” and its “provider”.

Model for the provider

  • This model has to extend Authenticatable
  • Config some params.

Login Controller

Middleware

Protection by Route:

Protection by middleware

Reference: