RouteServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\Facades\Route;
6
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
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 = 'App\Http\Controllers';
18
19
    /**
20
     * Define your route model bindings, pattern filters, etc.
21
     *
22
     * @return void
23
     */
24 5
    public function boot()
25
    {
26
        //
27
28 5
        parent::boot();
29 5
    }
30
31
    /**
32
     * Define the routes for the application.
33
     *
34
     * @return void
35
     */
36 5
    public function map()
37
    {
38 5
        $this->mapApiRoutes();
39
40 5
        $this->mapWebRoutes();
41
42
        //
43 5
    }
44
45
    /**
46
     * Define the "web" routes for the application.
47
     *
48
     * These routes all receive session state, CSRF protection, etc.
49
     *
50
     * @return void
51
     */
52 5
    protected function mapWebRoutes()
53
    {
54 5
        Route::middleware('web')
55 5
                ->namespace($this->namespace)
56 5
                ->group(base_path('routes/web.php'));
57 5
    }
58
59
    /**
60
     * Define the "api" routes for the application.
61
     *
62
     * These routes are typically stateless.
63
     *
64
     * @return void
65
     */
66 5
    protected function mapApiRoutes()
67
    {
68 5
        Route::prefix('api')
69 5
                ->middleware('api')
70 5
                ->namespace($this->namespace)
71 5
                ->group(base_path('routes/api.php'));
72 5
    }
73
}
74