1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* NOTICE OF LICENSE |
5
|
|
|
* |
6
|
|
|
* Part of the Rinvex Fort Package. |
7
|
|
|
* |
8
|
|
|
* This source file is subject to The MIT License (MIT) |
9
|
|
|
* that is bundled with this package in the LICENSE file. |
10
|
|
|
* |
11
|
|
|
* Package: Rinvex Fort Package |
12
|
|
|
* License: The MIT License (MIT) |
13
|
|
|
* Link: https://rinvex.com |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
namespace Rinvex\Fort\Http\Controllers\Backend; |
17
|
|
|
|
18
|
|
|
use Illuminate\Http\Request; |
19
|
|
|
use Rinvex\Fort\Models\Role; |
20
|
|
|
use Illuminate\Support\Facades\Lang; |
21
|
|
|
use Rinvex\Fort\Contracts\RoleRepositoryContract; |
22
|
|
|
use Rinvex\Fort\Http\Controllers\AuthorizedController; |
23
|
|
|
|
24
|
|
|
class RolesController extends AuthorizedController |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* {@inheritdoc} |
28
|
|
|
*/ |
29
|
|
|
protected $resourceAbilityMap = [ |
30
|
|
|
'assign' => 'assign', |
31
|
|
|
'remove' => 'remove', |
32
|
|
|
]; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* The role repository instance. |
36
|
|
|
* |
37
|
|
|
* @var \Rinvex\Fort\Contracts\RoleRepositoryContract |
38
|
|
|
*/ |
39
|
|
|
protected $roleRepository; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Create a new users controller instance. |
43
|
|
|
* |
44
|
|
|
* @param \Rinvex\Fort\Contracts\RoleRepositoryContract $roleRepository |
45
|
|
|
* |
46
|
|
|
* @return void |
|
|
|
|
47
|
|
|
*/ |
48
|
|
|
public function __construct(RoleRepositoryContract $roleRepository) |
49
|
|
|
{ |
50
|
|
|
parent::__construct(); |
51
|
|
|
|
52
|
|
|
$this->authorizeResource(Role::class); |
53
|
|
|
|
54
|
|
|
$this->roleRepository = $roleRepository; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Display a listing of the resource. |
59
|
|
|
* |
60
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
61
|
|
|
*/ |
62
|
|
|
public function index() |
63
|
|
|
{ |
64
|
|
|
// |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Display the specified resource. |
69
|
|
|
* |
70
|
|
|
* @param int $id |
71
|
|
|
* |
72
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
73
|
|
|
*/ |
74
|
|
|
public function show($id) |
|
|
|
|
75
|
|
|
{ |
76
|
|
|
// |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Bulk control the given resources. |
81
|
|
|
* |
82
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
83
|
|
|
*/ |
84
|
|
|
public function bulk() |
85
|
|
|
{ |
86
|
|
|
// |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Show the form for creating a new resource. |
91
|
|
|
* |
92
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
93
|
|
|
*/ |
94
|
|
|
public function create() |
95
|
|
|
{ |
96
|
|
|
// |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Store a newly created resource in storage. |
101
|
|
|
* |
102
|
|
|
* @param \Illuminate\Http\Request $request |
103
|
|
|
* |
104
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
105
|
|
|
*/ |
106
|
|
|
public function store(Request $request) |
|
|
|
|
107
|
|
|
{ |
108
|
|
|
// |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Show the form for copying the given resource. |
113
|
|
|
* |
114
|
|
|
* @param int $id |
115
|
|
|
* |
116
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
117
|
|
|
*/ |
118
|
|
|
public function copy($id) |
|
|
|
|
119
|
|
|
{ |
120
|
|
|
// |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Show the form for editing the given resource. |
125
|
|
|
* |
126
|
|
|
* @param int $id |
127
|
|
|
* |
128
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
129
|
|
|
*/ |
130
|
|
|
public function edit($id) |
|
|
|
|
131
|
|
|
{ |
132
|
|
|
// |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Update the given resource in storage. |
137
|
|
|
* |
138
|
|
|
* @param \Illuminate\Http\Request $request |
139
|
|
|
* @param int $id |
140
|
|
|
* |
141
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
142
|
|
|
*/ |
143
|
|
|
public function update(Request $request, $id) |
|
|
|
|
144
|
|
|
{ |
145
|
|
|
// |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* Delete the given resource from storage. |
150
|
|
|
* |
151
|
|
|
* @param int $id |
152
|
|
|
* |
153
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
154
|
|
|
*/ |
155
|
|
|
public function destroy($id) |
|
|
|
|
156
|
|
|
{ |
157
|
|
|
// |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Import the given resources into storage. |
162
|
|
|
* |
163
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
164
|
|
|
*/ |
165
|
|
|
public function import() |
166
|
|
|
{ |
167
|
|
|
// |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Export the given resources from storage. |
172
|
|
|
* |
173
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
174
|
|
|
*/ |
175
|
|
|
public function export() |
176
|
|
|
{ |
177
|
|
|
// |
178
|
|
|
} |
179
|
|
|
} |
180
|
|
|
|
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.