1
|
|
|
<?php namespace Arcanesoft\Auth\Http\Routes\Admin; |
2
|
|
|
|
3
|
|
|
use Arcanedev\Support\Routing\RouteRegistrar; |
4
|
|
|
use Arcanesoft\Auth\Models\Permission; |
5
|
|
|
use Arcanesoft\Auth\Models\PermissionsGroup; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class PermissionsRoutes |
9
|
|
|
* |
10
|
|
|
* @package Arcanesoft\Auth\Http\Routes\Admin |
11
|
|
|
* @author ARCANEDEV <[email protected]> |
12
|
|
|
*/ |
13
|
|
|
class PermissionsRoutes extends RouteRegistrar |
14
|
|
|
{ |
15
|
|
|
/* ----------------------------------------------------------------- |
16
|
|
|
| Main Methods |
17
|
|
|
| ----------------------------------------------------------------- |
18
|
|
|
*/ |
19
|
|
|
/** |
20
|
|
|
* Map routes. |
21
|
|
|
*/ |
22
|
12 |
|
public function map() |
23
|
|
|
{ |
24
|
|
|
$this->bind('auth_permission', function($hashedId) { |
25
|
|
|
return Permission::firstHashedOrFail($hashedId); |
26
|
12 |
|
}); |
27
|
|
|
|
28
|
|
|
$this->bind('auth_permissions_group', function($hashedId) { |
29
|
|
|
return PermissionsGroup::firstHashedOrFail($hashedId); |
30
|
12 |
|
}); |
31
|
|
|
|
32
|
|
|
$this->prefix('permissions')->name('permissions.')->group(function () { |
33
|
12 |
|
$this->get('/', 'PermissionsController@index') |
34
|
12 |
|
->name('index'); // admin::auth.permissions.index |
35
|
|
|
|
36
|
12 |
|
$this->get('group/{auth_permissions_group}', 'PermissionsController@group') |
37
|
12 |
|
->name('group'); // admin::auth.permissions.group |
38
|
|
|
|
39
|
12 |
|
$this->prefix('{auth_permission}')->group(function () { |
40
|
12 |
|
$this->get('/', 'PermissionsController@show') |
41
|
12 |
|
->name('show'); // admin::auth.permissions.show |
42
|
|
|
|
43
|
12 |
|
$this->middleware('ajax') |
44
|
12 |
|
->delete('roles/{auth_role}/detach', 'PermissionsController@detachRole') |
45
|
12 |
|
->name('roles.detach'); // admin::auth.permissions.roles.detach |
46
|
12 |
|
}); |
47
|
12 |
|
}); |
48
|
12 |
|
} |
49
|
|
|
} |
50
|
|
|
|