Completed
Push — master ( 09fb95...745d13 )
by ARCANEDEV
03:21
created

RolesRoutes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 97.67%

Importance

Changes 7
Bugs 0 Features 0
Metric Value
wmc 1
c 7
b 0
f 0
lcom 1
cbo 2
dl 0
loc 67
ccs 42
cts 43
cp 0.9767
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 55 1
1
<?php namespace Arcanesoft\Auth\Http\Routes\Foundation;
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\Foundation
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 24
    public function map(Registrar $router)
25
    {
26 24
        $this->group([
27 24
            'prefix'    => 'roles',
28 18
            'as'        => 'roles.',
29
        ], function () {
30 24
            $this->get('/', [
31 24
                'as'   => 'index',         // auth::foundation.roles.index
32 18
                'uses' => 'RolesController@index',
33 18
            ]);
34
35 24
            $this->get('create', [
36 24
                'as'   => 'create',        // auth::foundation.roles.create
37 18
                'uses' => 'RolesController@create',
38 18
            ]);
39
40 24
            $this->post('store', [
41 24
                'as'   => 'store',         // auth::foundation.roles.store
42 18
                'uses' => 'RolesController@store',
43 18
            ]);
44
45 24
            $this->group([
46
                'prefix' => '{role_id}'
47
            ], function () {
48 24
                $this->get('show', [
49 24
                    'as'   => 'show',      // auth::foundation.roles.show
50 18
                    'uses' => 'RolesController@show',
51 18
                ]);
52
53 24
                $this->get('edit', [
54 24
                    'as'   => 'edit',      // auth::foundation.roles.edit
55 18
                    'uses' => 'RolesController@edit',
56 18
                ]);
57
58 24
                $this->put('update', [
59 24
                    'as'   => 'update',    // auth::foundation.roles.update
60 18
                    'uses' => 'RolesController@update',
61 18
                ]);
62
63 24
                $this->put('activate', [
64 24
                    'as'   => 'activate',  // auth::foundation.roles.activate
65 18
                    'uses' => 'RolesController@activate',
66 18
                ]);
67
68 24
                $this->delete('delete', [
69 24
                    'as'   => 'delete',    // auth::foundation.roles.delete
70 18
                    'uses' => 'RolesController@delete',
71 18
                ]);
72 24
            });
73 24
        });
74
75 24
        $this->bind('role_id', function($hashedId) {
0 ignored issues
show
Bug introduced by
The method bind() does not seem to exist on object<Arcanesoft\Auth\H...Foundation\RolesRoutes>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
76
            return Role::firstHashedOrFail($hashedId);
77 24
        });
78 24
    }
79
}
80