AuthRoutes   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B map() 0 26 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 auth routes class.
18
 */
19
class AuthRoutes
20
{
21
    /**
22
     * Define the auth routes.
23
     *
24
     * @param \Illuminate\Contracts\Routing\Registrar $router
25
     */
26
    public function map(Registrar $router)
27
    {
28
        $router->group([
29
            'as' => 'auth.',
30
            'middleware' => 'app.hasSetting',
31
            'prefix' => 'auth',
32
            'setting' => 'app_name',
33
        ], function ($router) {
34
            $router->get('login', [
35
                'middleware' => 'guest',
36
                'as' => 'login',
37
                'uses' => 'AuthController@showLogin',
38
            ]);
39
40
            $router->post('login', [
41
                'middleware' => ['guest', 'csrf'],
42
                'uses' => 'AuthController@postLogin',
43
            ]);
44
45
            $router->get('logout', [
46
                'as' => 'logout',
47
                'uses' => 'AuthController@logoutAction',
48
                'middleware' => 'auth',
49
            ]);
50
        });
51
    }
52
}
53