1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
invoiceninja/app/Providers/AuthServiceProvider.php

41 lines
911 B
PHP
Raw Normal View History

2018-10-04 19:10:43 +02:00
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
2018-10-04 19:10:43 +02:00
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Auth;
2018-10-04 19:10:43 +02:00
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
*/
2018-10-04 19:10:43 +02:00
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']);
});
}
2018-10-04 19:10:43 +02:00
}