Completed
Push — master ( 720025...0e57e6 )
by ARCANEDEV
04:07
created

RolesRoutes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 95.65%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 46
c 0
b 0
f 0
ccs 22
cts 23
cp 0.9565
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B map() 0 34 1
1
<?php namespace Arcanesoft\Auth\Http\Routes\Admin;
2
3
use Arcanedev\Support\Bases\RouteRegister;
4
use Arcanesoft\Auth\Models\Role;
5
use Illuminate\Contracts\Routing\Registrar;
6
7
/**
8
 * Class     RolesRoutes
9
 *
10
 * @package  Arcanesoft\Auth\Http\Routes\Admin
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class RolesRoutes extends RouteRegister
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Main Functions
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    /**
20
     * Map routes.
21
     *
22
     * @param  \Illuminate\Contracts\Routing\Registrar  $router
23
     */
24 12
    public function map(Registrar $router)
25
    {
26
        $this->bind('auth_role', function($hashedId) {
27
            return Role::firstHashedOrFail($hashedId);
28 12
        });
29
30
        $this->group(['prefix' => 'roles', 'as' => 'roles.'], function () {
31 12
            $this->get('/', 'RolesController@index')
32 12
                 ->name('index'); // admin::auth.roles.index
33
34 12
            $this->get('create', 'RolesController@create')
35 12
                 ->name('create'); // admin::auth.roles.create
36
37 12
            $this->post('store', 'RolesController@store')
38 12
                 ->name('store'); // admin::auth.roles.store
39
40 12
            $this->group(['prefix' => '{auth_role}'], function () {
41 12
                $this->get('/', 'RolesController@show')
42 12
                     ->name('show'); // admin::auth.roles.show
43
44 12
                $this->get('edit', 'RolesController@edit')
45 12
                     ->name('edit'); // admin::auth.roles.edit
46
47 12
                $this->put('update', 'RolesController@update')
48 12
                     ->name('update'); // admin::auth.roles.update
49
50 12
                $this->put('activate', 'RolesController@activate')
51 12
                     ->name('activate'); // admin::auth.roles.activate
52
53 12
                $this->delete('delete', 'RolesController@delete')
54 12
                     ->name('delete'); // admin::auth.roles.delete
55 12
            });
56 12
        });
57 12
    }
58
}
59