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

UsersRoutes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 98.18%

Importance

Changes 10
Bugs 0 Features 0
Metric Value
wmc 1
c 10
b 0
f 0
lcom 1
cbo 2
dl 0
loc 82
ccs 54
cts 55
cp 0.9818
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 70 1
1
<?php namespace Arcanesoft\Auth\Http\Routes\Foundation;
2
3
use Arcanedev\Support\Bases\RouteRegister;
4
use Arcanesoft\Auth\Models\User;
5
use Illuminate\Contracts\Routing\Registrar;
6
7
/**
8
 * Class     UsersRoutes
9
 *
10
 * @package  Arcanesoft\Auth\Http\Routes\Foundation
11
 * @author   ARCANEDEV <[email protected]>
12
 */
13
class UsersRoutes 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'    => 'users',
28 18
            'as'        => 'users.',
29
        ], function () {
30 24
            $this->get('/', [
31 24
                'as'   => 'index',         // auth::foundation.users.index
32 18
                'uses' => 'UsersController@index',
33 18
            ]);
34
35 24
            $this->get('trash', [
36 24
                'as'   => 'trash',         // auth::foundation.users.trash
37 18
                'uses' => 'UsersController@trashList',
38 18
            ]);
39
40 24
            $this->get('roles-filter/{role_id}', [
41 24
                'as'   => 'roles-filter.index',  // auth::foundation.users.roles-filter.index
42 18
                'uses' => 'UsersController@listByRole',
43 18
            ]);
44
45 24
            $this->get('create', [
46 24
                'as'   => 'create',        // auth::foundation.users.create
47 18
                'uses' => 'UsersController@create',
48 18
            ]);
49
50 24
            $this->post('store', [
51 24
                'as'   => 'store',         // auth::foundation.users.store
52 18
                'uses' => 'UsersController@store',
53 18
            ]);
54
55 24
            $this->group([
56
                'prefix' => '{user_id}'
57
            ], function () {
58 24
                $this->get('show', [
59 24
                    'as'   => 'show',      // auth::foundation.users.show
60 18
                    'uses' => 'UsersController@show',
61 18
                ]);
62
63 24
                $this->get('edit', [
64 24
                    'as'   => 'edit',      // auth::foundation.users.edit
65 18
                    'uses' => 'UsersController@edit',
66 18
                ]);
67
68 24
                $this->put('update', [
69 24
                    'as'   => 'update',    // auth::foundation.users.update
70 18
                    'uses' => 'UsersController@update',
71 18
                ]);
72
73 24
                $this->put('activate', [
74 24
                    'as'   => 'activate',  // auth::foundation.users.activate
75 18
                    'uses' => 'UsersController@activate',
76 18
                ]);
77
78 24
                $this->put('restore', [
79 24
                    'as'   => 'restore',   // auth::foundation.users.restore
80 18
                    'uses' => 'UsersController@restore',
81 18
                ]);
82
83 24
                $this->delete('delete', [
84 24
                    'as'   => 'delete',    // auth::foundation.users.delete
85 18
                    'uses' => 'UsersController@delete',
86 18
                ]);
87 24
            });
88 24
        });
89
90 24
        $this->bind('user_id', function($hashedId) {
0 ignored issues
show
Bug introduced by
The method bind() does not seem to exist on object<Arcanesoft\Auth\H...Foundation\UsersRoutes>.

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...
91
            return User::firstHashedOrFail($hashedId);
92 24
        });
93 24
    }
94
}
95