Passed
Branch dev5a (b4693d)
by Ron
27:36
created

RouteServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 50
ccs 22
cts 22
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A mapAdminRoutes() 0 5 1
A boot() 0 3 1
A mapUserRoutes() 0 5 1
A mapWebRoutes() 0 5 1
A map() 0 6 1
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
     * In addition, it is set as the URL generator's root namespace.
13
     */
14
    protected $namespace = 'App\Http\Controllers';
15
    public const HOME    = '/dashboard';
16
17
    /**
18
     * Define your route model bindings, pattern filters, etc.
19
     */
20 96
    public function boot()
21
    {
22 96
        parent::boot();
23 96
    }
24
25
    /**
26
     * Define the routes for the application.
27
     */
28 96
    public function map()
29
    {
30
        // $this->mapApiRoutes();
31 96
        $this->mapWebRoutes();
32 96
        $this->mapUserRoutes();
33 96
        $this->mapAdminRoutes();
34 96
    }
35
36
    /**
37
     * Define the basic web routes for the application.
38
     */
39 96
    protected function mapWebRoutes()
40
    {
41 96
        Route::middleware('web')
42 96
                ->namespace($this->namespace)
43 96
                ->group(base_path('routes/web.php'));
44 96
    }
45
46 96
    protected function mapUserRoutes()
47
    {
48 96
        Route::middleware('web')
49 96
                ->namespace($this->namespace)
50 96
                ->group(base_path('routes/user.php'));
51 96
    }
52
53 96
    protected function mapAdminRoutes()
54
    {
55 96
        Route::middleware('web')
56 96
                ->namespace($this->namespace)
57 96
                ->group(base_path('routes/administration.php'));
58 96
    }
59
60
    /**
61
     * Define the "api" routes for the application.
62
     * These routes are typically stateless.
63
     */
64
    // protected function mapApiRoutes()
65
    // {
66
    //     Route::prefix('api')
67
    //             ->middleware('api')
68
    //             ->namespace($this->namespace)
69
    //             ->group(base_path('routes/api.php'));
70
    // }
71
}
72