AdminRoutes   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 1
dl 0
loc 51
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B map() 0 43 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