RouteServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace SET\Providers;
4
5
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
6
use Illuminate\Support\Facades\Route;
7
8
class RouteServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * This namespace is applied to your controller routes.
12
     *
13
     * In addition, it is set as the URL generator's root namespace.
14
     *
15
     * @var string
16
     */
17
    protected $namespace = 'SET\Http\Controllers';
18
19
    /**
20
     * Define your route model bindings, pattern filters, etc.
21
     *
22
     * @return void
23
     */
24
    public function boot()
25
    {
26
        //
27
        parent::boot();
28
    }
29
30
    /**
31
     * Define the routes for the application.
32
     *
33
     * @return void
34
     */
35
    public function map()
36
    {
37
        $this->mapApiRoutes();
38
        $this->mapWebRoutes();
39
        //
40
    }
41
42
    /**
43
     * Define the "web" routes for the application.
44
     *
45
     * These routes all receive session state, CSRF protection, etc.
46
     *
47
     * @return void
48
     */
49
    protected function mapWebRoutes()
50
    {
51
        Route::group([
52
            'middleware' => 'web',
53
            'namespace'  => $this->namespace,
54
        ], function () {
55
            require base_path('routes/web.php');
56
        });
57
    }
58
59
    /**
60
     * Define the "api" routes for the application.
61
     *
62
     * These routes are typically stateless.
63
     *
64
     * @return void
65
     */
66
    protected function mapApiRoutes()
67
    {
68
        Route::group([
69
            'middleware' => 'api',
70
            'namespace'  => $this->namespace,
71
            'prefix'     => 'api',
72
        ], function () {
73
            require base_path('routes/api.php');
74
        });
75
    }
76
}
77