1 | <?php |
||
23 | class AbilitiesController extends AuthorizedController |
||
24 | { |
||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | protected $resourceAbilityMap = [ |
||
29 | 'give' => 'give', |
||
30 | 'revoke' => 'revoke', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * The ability repository instance. |
||
35 | * |
||
36 | * @var \Rinvex\Fort\Contracts\AbilityRepositoryContract |
||
37 | */ |
||
38 | protected $abilityRepository; |
||
39 | |||
40 | /** |
||
41 | * Create a new abilities controller instance. |
||
42 | * |
||
43 | * @return void |
||
|
|||
44 | */ |
||
45 | public function __construct(AbilityRepositoryContract $abilityRepository) |
||
53 | |||
54 | /** |
||
55 | * Display a listing of the resource. |
||
56 | * |
||
57 | * @return \Illuminate\Http\Response |
||
58 | */ |
||
59 | public function index() |
||
65 | |||
66 | /** |
||
67 | * Display the specified resource. |
||
68 | * |
||
69 | * @param int $id |
||
70 | * |
||
71 | * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse |
||
72 | */ |
||
73 | public function show($id) |
||
84 | |||
85 | /** |
||
86 | * Bulk control the given resources. |
||
87 | * |
||
88 | * @return \Illuminate\Http\Response |
||
89 | */ |
||
90 | public function bulk() |
||
94 | |||
95 | /** |
||
96 | * Show the form for creating a new resource. |
||
97 | * |
||
98 | * @return \Illuminate\Http\Response |
||
99 | */ |
||
100 | public function create() |
||
104 | |||
105 | /** |
||
106 | * Show the form for copying the given resource. |
||
107 | * |
||
108 | * @param int $id |
||
109 | * |
||
110 | * @return \Illuminate\Http\Response |
||
111 | */ |
||
112 | public function copy($id) |
||
116 | |||
117 | /** |
||
118 | * Show the form for editing the given resource. |
||
119 | * |
||
120 | * @param int $id |
||
121 | * |
||
122 | * @return \Illuminate\Http\Response |
||
123 | */ |
||
124 | public function edit($id) |
||
128 | |||
129 | /** |
||
130 | * Show the form for create/edit/copy of the given resource. |
||
131 | * |
||
132 | * @param string $mode |
||
133 | * @param string $action |
||
134 | * @param int|null $id |
||
135 | * |
||
136 | * @return \Illuminate\Http\Response |
||
137 | */ |
||
138 | protected function form($mode, $action, $id = null) |
||
149 | |||
150 | /** |
||
151 | * Store a newly created resource in storage. |
||
152 | * |
||
153 | * @param \Illuminate\Http\Request $request |
||
154 | * |
||
155 | * @return \Illuminate\Http\Response |
||
156 | */ |
||
157 | public function store(Request $request) |
||
161 | |||
162 | /** |
||
163 | * Update the given resource in storage. |
||
164 | * |
||
165 | * @param \Illuminate\Http\Request $request |
||
166 | * @param int $id |
||
167 | * |
||
168 | * @return \Illuminate\Http\Response |
||
169 | */ |
||
170 | public function update(Request $request, $id) |
||
174 | |||
175 | /** |
||
176 | * Delete the given resource from storage. |
||
177 | * |
||
178 | * @param int $id |
||
179 | * |
||
180 | * @return \Illuminate\Http\Response |
||
181 | */ |
||
182 | public function delete($id) |
||
186 | |||
187 | /** |
||
188 | * Import the given resources into storage. |
||
189 | * |
||
190 | * @return \Illuminate\Http\Response |
||
191 | */ |
||
192 | public function import() |
||
196 | |||
197 | /** |
||
198 | * Export the given resources from storage. |
||
199 | * |
||
200 | * @return \Illuminate\Http\Response |
||
201 | */ |
||
202 | public function export() |
||
206 | } |
||
207 |
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.