andrewboy / laravel-multi-auth
Laravel 5.1 package for laravel multi auth.
Installs: 1 028
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
- kbwebs/multiauth: ~1.0
Requires (Dev)
- illuminate/contracts: 5.1.*
- illuminate/mail: 5.1.*
- illuminate/support: 5.1.*
This package is not auto-updated.
Last update: 2024-11-23 20:42:18 UTC
README
This package can be use with only 5.1 version of laravel. This package extends the Kbwebs/MultiAuth package by overriding the default single laravel auth traits. With this package you can easily use the auth mechanism that laravel default offers.
Overwritten traits
AuthenticatesAndRegistersUsers
Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers
to
Andrewboy\LaravelMultiAuth\Traits\AuthenticatesAndRegistersUsers
AuthenticatesUsers
Illuminate\Foundation\Auth\AuthenticatesUsers
to
Andrewboy\LaravelMultiAuth\Traits\AuthenticatesUsers
RegistersUsers
Illuminate\Foundation\Auth\RegistersUsers
to
Andrewboy\LaravelMultiAuth\Traits\RegistersUsers
ResetsPasswords
Illuminate\Foundation\Auth\ResetsPasswords
to
Andrewboy\LaravelMultiAuth\Traits\ResetsPasswords
Installation steps
-
First setup the Kbwebs/MultiAuth package
-
In config/app.php set the provider:
... 'providers' => [ ... Andrewboy\LaravelMultiAuth\LaravelMultiAuthServiceProvider::class, ], ...
-
Set the controllers
AuthController
use Andrewboy\LaravelMultiAuth\Traits\AuthenticatesAndRegistersUsers; class AuthController extends Controller { use AuthenticatesAndRegistersUsers, ThrottlesLogins; protected $entity = 'admin'; ... }
PasswordController
use Andrewboy\LaravelMultiAuth\Traits\ResetsPasswords; class PasswordController extends Controller { use ResetsPasswords; protected $entity = 'admin'; ... }
Note: if you have only one entity, then you don't have to use the protected $entity property.