Passed
Push — ft/appmove ( db87fd...97613e )
by Philippe
45:05 queued 26:47
created

AuthServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 1
nop 0
dl 0
loc 6
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Thinktomorrow\Chief\App\Providers;
4
5
use Thinktomorrow\Chief\Authorization\ChiefUserProvider;
6
use Illuminate\Support\Facades\Auth;
7
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
8
9
class AuthServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any authentication / authorization services.
13
     *
14
     * @return void
15
     */
16
    public function boot()
17
    {
18
        $this->registerPolicies();
19
20
        Auth::provider('chief-eloquent', function ($app, array $config) {
21
            return new ChiefUserProvider($app['hash'], $config['model']);
22
        });
23
    }
24
}
25