LaravelHttpsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php namespace Padosoft\Laravel\Https;
2
3
use Illuminate\Routing\Router;
4
use Illuminate\Support\ServiceProvider;
5
use Padosoft\Laravel\Https\Middleware\HttpsForceMiddleware;
6
7
class LaravelHttpsServiceProvider extends ServiceProvider
8
{
9
10
    /**
11
     * Indicates if loading of the provider is deferred.
12
     *
13
     * @var bool
14
     */
15
    protected $defer = false;
16
17
    /**
18
     * Bootstrap the application events.
19
     *
20
     * @param Router $router
21
     */
22
    public function boot(Router $router)
23
    {
24
        $router->middlewareGroup('HttpsForce', [HttpsForceMiddleware::class]);
25
    }
26
27
    /**
28
     * Register the service provider.
29
     *
30
     * @return void
31
     */
32
    public function register()
33
    {
34
        $configPath = __DIR__ . '/../config/config.php';
35
        $this->mergeConfigFrom($configPath, 'laravel-https');
36
        $this->publishes([$configPath => config_path('laravel-https.php')], 'laravel-https');
37
    }
38
}
39
40