Completed
Push — master ( 71c1d9...f78dbb )
by ARCANEDEV
03:55
created

RouteServiceProvider::map()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 6
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 6
b 0
f 0
1
<?php namespace Arcanesoft\Foundation\Providers;
2
3
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;
4
use Arcanesoft\Foundation\Http\Routes;
5
use Illuminate\Contracts\Routing\Registrar as Router;
6
7
/**
8
 * Class     RouteServiceProvider
9
 *
10
 * @package  Arcanesoft\Foundation\Providers
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class RouteServiceProvider extends ServiceProvider
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Getters & Setters
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Get the routes namespace
21
     *
22
     * @return string
23
     */
24
    protected function getRouteNamespace()
25
    {
26
        return 'Arcanesoft\\Foundation\\Http\\Routes';
27
    }
28
29
    /* ------------------------------------------------------------------------------------------------
30
     |  Main Functions
31
     | ------------------------------------------------------------------------------------------------
32
     */
33
    /**
34
     * Define the routes for the application.
35
     *
36
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
37
     */
38 12
    public function map(Router $router)
39
    {
40 12
        $this->mapAdminRoutes($router);
41 12
    }
42
43
    /* ------------------------------------------------------------------------------------------------
44
     |  Other Functions
45
     | ------------------------------------------------------------------------------------------------
46
     */
47
    /**
48
     * Map the admin routes.
49
     *
50
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
51
     */
52 12
    private function mapAdminRoutes(Router $router)
53
    {
54 12
        $attributes = array_merge($this->getFoundationRouteGroup(), [
55 12
            'as'        => 'admin::foundation',
56 6
            'namespace' => 'Arcanesoft\\Foundation\\Http\\Controllers\\Admin',
57 6
        ]);
58
59 12
        $router->group($attributes, function (Router $router) {
60 12
            Routes\Admin\DashboardRoute::register($router);
61 12
            Routes\Admin\SettingsRoutes::register($router);
62 12
            Routes\Admin\SystemRoutes::register($router);
63 12
        });
64 12
    }
65
}
66