AdminRoutes::map()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 43
Code Lines 30

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 2
Metric Value
c 3
b 1
f 2
dl 0
loc 43
rs 8.8571
cc 1
eloc 30
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 *
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Http\Routes;
13
14
use Illuminate\Contracts\Routing\Registrar;
15
16
/**
17
 * This is the admin routes class.
18
 */
19
class AdminRoutes
20
{
21
    /**
22
     * Define the admin routes.
23
     *
24
     * @param \Illuminate\Contracts\Routing\Registrar $router
25
     */
26
    public function map(Registrar $router)
27
    {
28
        //Dashboard area
29
        $router->group([
30
            'middleware' => ['auth', 'admin'],
31
            'prefix' => 'admin',
32
            'namespace' => 'Admin',
33
            'as' => 'admin.',
34
        ], function ($router) {
35
            $router->get('/', [
36
                'as' => 'index',
37
                'uses' => 'DashboardController@indexAction',
38
            ]);
39
40
             // Settings
41
            $router->group([
42
                'as' => 'settings.',
43
                'prefix' => 'settings',
44
            ], function ($router) {
45
                $router->get('general', [
46
                    'as' => 'general',
47
                    'uses' => 'SettingsController@showGeneralView',
48
                ]);
49
                $router->get('localization', [
50
                    'as' => 'localization',
51
                    'uses' => 'SettingsController@showLocalizationView',
52
                ]);
53
                $router->get('timezone', [
54
                    'as' => 'timezone',
55
                    'uses' => 'SettingsController@showTimezoneView',
56
                ]);
57
                $router->get('theme', [
58
                    'as' => 'theme',
59
                    'uses' => 'SettingsController@showThemeView',
60
                ]);
61
                $router->get('stylesheet', [
62
                    'as' => 'stylesheet',
63
                    'uses' => 'SettingsController@showStylesheetView',
64
                ]);
65
                $router->post('/', 'SettingsController@postSettings');
66
            });
67
        });
68
    }
69
}
70