Multi Auth and admin auth in Laravel Project
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.
php artisan make:auth.To install this package, follow these steps:
composer require sarthaks/multi-auth
php artisan vendor:publish --tag=multi-auth-config
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.
Run the migration command to create the necessary tables for the admin authentication:
php artisan migrate
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.
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.