mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 06:32:40 +01:00
41 lines
911 B
PHP
41 lines
911 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
use Auth;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* The policy mappings for the application.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $policies = [
|
|
'App\Model' => 'App\Policies\ModelPolicy',
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*
|
|
* @return void
|
|
*/
|
|
|
|
public function boot()
|
|
{
|
|
$this->registerPolicies();
|
|
|
|
Auth::provider('users', function ($app, array $config) {
|
|
return new MultiDatabaseUserProvider($this->app['hash'], $config['model']);
|
|
});
|
|
|
|
Auth::provider('contacts', function ($app, array $config) {
|
|
return new MultiDatabaseUserProvider($this->app['hash'], $config['model']);
|
|
|
|
});
|
|
}
|
|
|
|
}
|