Passed
Push — master ( d7d8c0...c26592 )
by Mads
03:35
created

AuthServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Napp\Core\Api\Auth;
4
5
use Illuminate\Support\Facades\Auth;
6
use Illuminate\Support\ServiceProvider;
7
8
class AuthServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * @return void
12
     */
13
    public function register()
14
    {
15
        Auth::extend('api', function ($app, $name, array $config) {
16
            return new ApiGuard(Auth::createUserProvider($config['provider']), $app['request']);
17
        });
18
    }
19
}
20