RouteServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\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 the controller routes in your routes file.
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 132
    public function boot()
25
    {
26 132
        parent::boot();
27 132
    }
28
29
    /**
30
     * Define the routes for the application.
31
     *
32
     * @return void
33
     */
34 132
    public function map()
35
    {
36 132
        $this->mapApiRoutes();
37 132
        $this->mapWebRoutes();
38
        //
39 132
    }
40
41
    /**
42
     * Define the "web" routes for the application.
43
     *
44
     * These routes all receive session state, CSRF protection, etc.
45
     *
46
     * @return void
47
     */
48 132
    protected function mapWebRoutes()
49
    {
50 132
        Route::middleware('web')
51 132
             ->namespace($this->namespace)
52 132
             ->group(base_path('routes/web.php'));
53 132
    }
54
55
    /**
56
     * Define the "api" routes for the application.
57
     *
58
     * These routes are typically stateless.
59
     *
60
     * @return void
61
     */
62 132
    protected function mapApiRoutes()
63
    {
64 132
        Route::prefix('api')
65 132
            ->middleware('api')
66 132
            ->namespace($this->namespace)
67 132
            ->group(base_path('routes/api.php'));
68 132
    }
69
}
70