AuthServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 1
1
<?php
2
3
namespace Yeelight\Providers;
4
5
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
6
use Laravel\Passport\Passport;
7
8
/**
9
 * Class AuthServiceProvider
10
 *
11
 * @category Yeelight
12
 *
13
 * @package Yeelight\Providers
14
 *
15
 * @author Sheldon Lee <[email protected]>
16
 *
17
 * @license https://opensource.org/licenses/MIT MIT
18
 *
19
 * @link https://www.yeelight.com
20
 */
21
class AuthServiceProvider extends ServiceProvider
22
{
23
    /**
24
     * The policy mappings for the application.
25
     *
26
     * @var array
27
     */
28
    protected $policies = [
29
        'Yeelight\Models' => 'Yeelight\Policies\ModelPolicy',
30
    ];
31
32
    /**
33
     * Register any authentication / authorization services.
34
     *
35
     * @return void
36
     */
37
    public function boot()
38
    {
39
        $this->registerPolicies();
40
41
        Passport::routes();
42
43
        // Token Lifetimes
44
//        Passport::tokensExpireIn(Carbon::now()->addDays(15));
45
46
        // Refresh Token Lifetimes
47
//        Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
48
49
        // Pruning Revoked Tokens
50
//        Passport::pruneRevokedTokens();
51
52
        // Token Scopes
53
//        Passport::tokensCan([
54
//            'place-orders' => 'Place orders',
55
//            'check-status' => 'Check order status',
56
//        ]);
57
    }
58
}
59