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\User; |
20
|
|
|
use Rinvex\Fort\Contracts\UserRepositoryContract; |
21
|
|
|
use Rinvex\Fort\Http\Controllers\AuthorizedController; |
22
|
|
|
|
23
|
|
|
class UsersController extends AuthorizedController |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* {@inheritdoc} |
27
|
|
|
*/ |
28
|
|
|
protected $resourceAbilityMap = [ |
29
|
|
|
'activate' => 'activate', |
30
|
|
|
'deactivate' => 'deactivate', |
31
|
|
|
]; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* The user repository instance. |
35
|
|
|
* |
36
|
|
|
* @var \Rinvex\Fort\Contracts\UserRepositoryContract |
37
|
|
|
*/ |
38
|
|
|
protected $userRepository; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Create a new users controller instance. |
42
|
|
|
* |
43
|
|
|
* @return void |
|
|
|
|
44
|
|
|
*/ |
45
|
|
|
public function __construct(UserRepositoryContract $userRepository) |
46
|
|
|
{ |
47
|
|
|
parent::__construct(); |
48
|
|
|
|
49
|
|
|
$this->authorizeResource(User::class); |
50
|
|
|
|
51
|
|
|
$this->userRepository = $userRepository; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Display a listing of the resource. |
56
|
|
|
* |
57
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
58
|
|
|
*/ |
59
|
|
|
public function index() |
60
|
|
|
{ |
61
|
|
|
$users = $this->userRepository->paginate(config('rinvex.fort.backend.items_per_page')); |
62
|
|
|
|
63
|
|
|
return view('rinvex.fort::backend.users.index', compact('users')); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Display the specified resource. |
68
|
|
|
* |
69
|
|
|
* @param int $id |
70
|
|
|
* |
71
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
72
|
|
|
*/ |
73
|
|
|
public function show($id) |
|
|
|
|
74
|
|
|
{ |
75
|
|
|
// |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Bulk control the given resources. |
80
|
|
|
* |
81
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
82
|
|
|
*/ |
83
|
|
|
public function bulk() |
84
|
|
|
{ |
85
|
|
|
// |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Show the form for creating a new resource. |
90
|
|
|
* |
91
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
92
|
|
|
*/ |
93
|
|
|
public function create() |
94
|
|
|
{ |
95
|
|
|
// |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Store a newly created resource in storage. |
100
|
|
|
* |
101
|
|
|
* @param \Illuminate\Http\Request $request |
102
|
|
|
* |
103
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
104
|
|
|
*/ |
105
|
|
|
public function store(Request $request) |
|
|
|
|
106
|
|
|
{ |
107
|
|
|
// |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Show the form for copying the given resource. |
112
|
|
|
* |
113
|
|
|
* @param int $id |
114
|
|
|
* |
115
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
116
|
|
|
*/ |
117
|
|
|
public function copy($id) |
|
|
|
|
118
|
|
|
{ |
119
|
|
|
// |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Show the form for editing the given resource. |
124
|
|
|
* |
125
|
|
|
* @param int $id |
126
|
|
|
* |
127
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
128
|
|
|
*/ |
129
|
|
|
public function edit($id) |
|
|
|
|
130
|
|
|
{ |
131
|
|
|
// |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* Update the given resource in storage. |
136
|
|
|
* |
137
|
|
|
* @param \Illuminate\Http\Request $request |
138
|
|
|
* @param int $id |
139
|
|
|
* |
140
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
141
|
|
|
*/ |
142
|
|
|
public function update(Request $request, $id) |
|
|
|
|
143
|
|
|
{ |
144
|
|
|
// |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* Delete the given resource from storage. |
149
|
|
|
* |
150
|
|
|
* @param int $id |
151
|
|
|
* |
152
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
153
|
|
|
*/ |
154
|
|
|
public function delete($id) |
|
|
|
|
155
|
|
|
{ |
156
|
|
|
// |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Import the given resources into storage. |
161
|
|
|
* |
162
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
163
|
|
|
*/ |
164
|
|
|
public function import() |
165
|
|
|
{ |
166
|
|
|
// |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Export the given resources from storage. |
171
|
|
|
* |
172
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
173
|
|
|
*/ |
174
|
|
|
public function export() |
175
|
|
|
{ |
176
|
|
|
// |
177
|
|
|
} |
178
|
|
|
} |
179
|
|
|
|
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.