Passed
Pull Request — master (#2)
by ANTHONIUS
05:01
created

AuthServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 2 1
A boot() 0 2 1
1
<?php
2
3
/*
4
 * This file is part of the EOffice project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace EOffice\Core\Providers;
15
16
use Illuminate\Http\Request;
17
use Illuminate\Support\ServiceProvider;
18
19
class AuthServiceProvider extends ServiceProvider
20
{
21
    /**
22
     * Register any application services.
23
     *
24
     * @return void
25
     */
26
    public function register()
27
    {
28
    }
29
30
    /**
31
     * Boot the authentication services for the application.
32
     *
33
     * @return void
34
     */
35
    public function boot()
36
    {
37
        // Here you may define how you wish users to be authenticated for your Lumen
38
        // application. The callback which receives the incoming request instance
39
        // should return either a User instance or null. You're free to obtain
40
        // the User instance via an API token or any other method necessary.
41
42
        /*
43
        $this->app['auth']->viaRequest('api', function (Request $request) {
44
            if ($request->input('token')) {
45
                return User::where('token', $request->input('api_token'))->first();
46
            }
47
        });
48
        */
49
    }
50
}
51