Package Data | |
---|---|
Maintainer Username: | chazzuka |
Maintainer Contact: | chazzuka@gmail.com (chz) |
Package Create Date: | 2014-12-02 |
Package Last Update: | 2014-12-02 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-23 15:05:05 |
Package Statistics | |
---|---|
Total Downloads: | 9 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
add multi tenant auth configuration at config/auth.php
'resolver' => [
'default' => 'member',
'member' => [
'driver' => 'eloquent',
'model' => 'App\Account\Member',
],
'audience' => [
'driver' => 'audience',
'model' => 'App\Audiences\Audience',
],
],
Replace laravel auth provider in config/app.php
with Chazzuka\Authron\AuthronServiceProvider
// login with default auth manager
Auth::attempt($crendetials);
Auth::guest();
Auth::check();
// above is equivalent to
Auth::member()->attempt($credentials);
Auth::member()->guest();
Auth::member()->check();
// login audience
Auth::audience()->attempt($credentials);
Auth::audience()->guest();
Auth::audience()->check();
Register custom user provider
// Register only for audience auth manager
$this->app['auth']->audience()->extend('audience', function ()
{
$provider = new AudienceProvider($this->app['audiences']);
return new Guard('audience', $provider, $this->app['session.store']);
});
// register for all registered managers
$this->app['auth']->extend('audience', function ()
{
$provider = new AudienceProvider($this->app['audiences']);
return new Guard('audience', $provider, $this->app['session.store']);
});