QRCodeServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Nathanmac\Utilities\QRCode;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class QRCodeServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap any application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->app->booted(function () {
17
            $this->defineRoutes();
18
        });
19
    }
20
21
    /**
22
     * Register the service provider.
23
     *
24
     * @return void
25
     */
26
    public function register()
27
    {
28
29
    }
30
31
    /**
32
     * Define the QRCode routes.
33
     *
34
     * @return void
35
     */
36
    protected function defineRoutes()
37
    {
38
        if (! $this->app->routesAreCached()) {
39
            $router = app('router');
40
41
            $router->group(['namespace' => 'Nathanmac\QRCode\Controllers'], function ($router) {
42
                require __DIR__.'/routes.php';
43
            });
44
        }
45
    }
46
}