Completed
Push — dev ( 161907...96e2cc )
by Alies
04:04
created

RouteServiceProvider::mapRedirectRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Diglabby\Doika\Providers;
4
5
use App\Providers\RouteServiceProvider as BasicRouteServiceProvider;
6
use Illuminate\Support\Facades\Route;
7
8
final class RouteServiceProvider extends BasicRouteServiceProvider
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 = 'Diglabby\Doika\Http\Controllers';
18
19
    /** @var string */
20
    protected $laravelNamespace = 'App\Http\Controllers';
21
22
    /**
23
     * Define the routes for the application.
24
     *
25
     * @return void
26
     */
27
    public function map()
28
    {
29
        $this->mapWidgetRoutes();
30
        $this->mapDashboardRoutes();
31
        $this->mapRedirectRoutes();
32
    }
33
34
    protected function mapWidgetRoutes()
35
    {
36
        Route::middleware('web')
37
            ->prefix('doika')
38
            ->namespace($this->namespace)
39
            ->group(base_path('routes/widget.php'));
40
    }
41
42
    protected function mapDashboardRoutes()
43
    {
44
        Route::middleware(['web'])
45
            ->prefix('doika/dashboard/')
46
            ->namespace($this->laravelNamespace)
47
            ->group(base_path('routes/auth.php'));
48
49
        Route::middleware(['web', 'auth'])
50
            ->prefix('doika/dashboard/')
51
            ->namespace($this->namespace)
52
            ->group(base_path('routes/dashboard.php'));
53
    }
54
55
    protected function mapRedirectRoutes()
56
    {
57
        Route::middleware(['web'])
58
            ->namespace($this->namespace)
59
            ->group(base_path('routes/redirects.php'));
60
    }
61
}
62