Laravel Multiauth screenshot

Laravel Multiauth

Author Avatar Theme by Bitfumes
Updated: 28 Nov 2020
465 Stars

Multi Auth and admin auth in Laravel Project

Categories

Overview:

This package is designed to create an admin side for multi-authentication in Laravel. It offers a solution that is completely separate from the normal authentication system created using php artisan make:auth. With this package, users can simultaneously login as both a regular user and an admin without any conflicts. Sarthak Shrivastava and other contributors maintain and develop this package.

Features:

  • Multi-Authentication: Allows users to have separate authentication for admin and regular users.
  • Simultaneous Login: Users can login as both an admin and a regular user at the same time without any conflicts.
  • Isolated from Default Authentication: The admin authentication provided by this package is completely separate from the default authentication system created using php artisan make:auth.
  • Open-Source: This package is open source and licensed under the MIT license.

Installation:

To install this package, follow these steps:

  1. Add the package to your Laravel project by running the following command in your terminal:
composer require sarthaks/multi-auth
  1. After the package is installed, you need to publish the configuration file. Run the following command:
php artisan vendor:publish --tag=multi-auth-config
  1. Open the config/multi-auth.php file and configure the authentication types you want to use. You can specify a different guard, provider, and table for each authentication type.

  2. Run the migration command to create the necessary tables for the admin authentication:

php artisan migrate
  1. Finally, update the app/Http/Kernel.php file to add the middleware for the admin authentication. Add the following line to the $routeMiddleware array:
'admin' => \App\Http\Middleware\CheckAdmin::class,

You can now use the multi-authentication feature in your Laravel project.

Summary:

This package provides a convenient solution for implementing multi-authentication in Laravel. It allows for separate authentication for admin and regular users, with the ability to simultaneously login as both without conflicts. The package is easy to install and configure, making it a valuable tool for managing different types of users in a Laravel application.