ShieldServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Clarkeash\Shield\Providers;
4
5
use Clarkeash\Shield\Http\Middleware\Shield;
6
use Illuminate\Support\ServiceProvider;
7
8
class ShieldServiceProvider extends ServiceProvider
9
{
10
    public function boot()
11
    {
12
        $this->publishes([
13
            __DIR__ . '/../../resources/config/shield.php' => config_path('shield.php'),
14
        ], 'config');
15
16
        $this->app['router']->aliasMiddleware('shield', Shield::class);
17
    }
18
19
    public function register()
20
    {
21
        $this->mergeConfigFrom(
22
            __DIR__ . '/../../resources/config/shield.php',
23
            'shield'
24
        );
25
    }
26
}
27