Multi Auth package for Laravel project.
alaminfirdows/laravel-multi-auth is a Laravel package for multi auth package for laravel project..
It currently has 10 GitHub stars and 753 downloads on Packagist (latest version v0.0.1-alpha).
Install it with composer require alaminfirdows/laravel-multi-auth.
Discover more Laravel packages by alaminfirdows
or browse all Laravel packages to compare alternatives.
Last updated
php artisan laravel-multi-auth:install {guard} -fphp artisan laravel-multi-auth:install {guard} -f --domainphp artisan laravel-multi-auth:install {guard} {service} -f --lucidThis a simple package to create the multi authentication feature on your Laravel 6.* project. By running some simple command you can setup multi auth for your Laravel project. The package installs:
composer require alaminfirdows/laravel-multi-auth
php artisan laravel-multi-auth:install {singular_lowercase_name_of_guard} -f
// Examples
php artisan laravel-multi-auth:install admin -f
php artisan laravel-multi-auth:install employee -f
php artisan laravel-multi-auth:install customer -f
Notice:
If you don't provide -f flag, it will not work. It is a protection against accidental activation.
Alternative:
If you want to install Multi-Auth files in a subdomain you must pass the option --domain.
php artisan laravel-multi-auth:install admin -f --domain
php artisan laravel-multi-auth:install employee -f --domain
php artisan laravel-multi-auth:install customer -f --domain
To be able to use this feature properly, you should add a key to your .env file:
APP_DOMAIN=yourdomain.com
This will allow us to use it in the routes file, prefixing it with the domain feature from Laravel routing system.
Using it like so: ['domain' => '{guard}.' . env('APP_DOMAIN')]
php artisan migrate
Go to: http://project_url/GuardName/login
Example: http://myproject.dev/customer/login
If you don't want model and migration use --model flag.
php artisan laravel-multi-auth:install admin -f --model
If you don't want views use --views flag.
php artisan laravel-multi-auth:install admin -f --views
If you don't want routes in your routes/web.php file, use --routes flag.
php artisan laravel-multi-auth:install admin -f --routes
If you want to change the redirect path for once your guard is logged out. Add and override the following method in
your {GuardName}\Auth\LoginController:
/**
* Get the path that we should redirect once logged out.
* Adaptable to user needs.
*
* @return string
*/
public function logoutToPath() {
return '/';
}
config/auth.php
app/Http/Providers/RouteServiceProvider.php
app/Http/Kernel.php
app/Http/Middleware/
app/Http/Controllers/{Guard}/Auth/
app/Models/{Guard}.php
app/Notifications/{Guard}/ResetPassword.php
database/migrations/
routes/web.php
routes/{guard}.php
resources/views/{guard}/
admin guard, don't install it again after you update package to latest version.I inspired to create this package from hesto/multi-auth.