1 | <?php |
||
26 | class UserController extends BaseApiController |
||
27 | { |
||
28 | /** |
||
29 | * List of all route actions that the base api controller |
||
30 | * will skip permissions check for them. |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $skipPermissionCheck = ['account', 'logout', 'changePassword', 'saveProfile', 'account']; |
||
34 | |||
35 | /** |
||
36 | * List of all route actions that the base api controller |
||
37 | * will skip login check for them. |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendReset', 'resetPassword', 'refreshToken', 'confirmEmail', 'resendEmailConfirmation']; |
||
41 | |||
42 | /** |
||
43 | * The loginProxy implementation. |
||
44 | * |
||
45 | * @var App\Modules\Acl\Proxy\LoginProxy |
||
46 | */ |
||
47 | protected $loginProxy; |
||
48 | |||
49 | /** |
||
50 | * Init new object. |
||
51 | * |
||
52 | * @param LoginProxy $loginProxy |
||
53 | * @param UserRepository $repo |
||
54 | * @param CoreConfig $config |
||
55 | * @return void |
||
|
|||
56 | */ |
||
57 | public function __construct(LoginProxy $loginProxy, UserRepository $repo, CoreConfig $config) |
||
62 | |||
63 | /** |
||
64 | * Insert the given model to storage. |
||
65 | * |
||
66 | * @param InsertUser $request |
||
67 | * @return \Illuminate\Http\Response |
||
68 | */ |
||
69 | public function insert(InsertUser $request) |
||
73 | |||
74 | /** |
||
75 | * Update the given model to storage. |
||
76 | * |
||
77 | * @param UpdateUser $request |
||
78 | * @return \Illuminate\Http\Response |
||
79 | */ |
||
80 | public function update(UpdateUser $request) |
||
84 | |||
85 | /** |
||
86 | * Return the logged in user account. |
||
87 | * |
||
88 | * @return \Illuminate\Http\Response |
||
89 | */ |
||
90 | public function account() |
||
94 | |||
95 | /** |
||
96 | * Block the user. |
||
97 | * |
||
98 | * @param integer $id Id of the user. |
||
99 | * @return \Illuminate\Http\Response |
||
100 | */ |
||
101 | public function block($id) |
||
105 | |||
106 | /** |
||
107 | * Unblock the user. |
||
108 | * |
||
109 | * @param integer $id Id of the user. |
||
110 | * @return \Illuminate\Http\Response |
||
111 | */ |
||
112 | public function unblock($id) |
||
116 | |||
117 | /** |
||
118 | * Logout the user. |
||
119 | * |
||
120 | * @return \Illuminate\Http\Response |
||
121 | */ |
||
122 | public function logout() |
||
126 | |||
127 | /** |
||
128 | * Handle a registration request. |
||
129 | * |
||
130 | * @param Register $request |
||
131 | * @return \Illuminate\Http\Response |
||
132 | */ |
||
133 | public function register(Register $request) |
||
137 | |||
138 | /** |
||
139 | * Handle a login request to the application. |
||
140 | * |
||
141 | * @param Login $request |
||
142 | * @return \Illuminate\Http\Response |
||
143 | */ |
||
144 | public function login(Login $request) |
||
150 | |||
151 | /** |
||
152 | * Handle a social login request of the none admin to the application. |
||
153 | * |
||
154 | * @param LoginSocial $request |
||
155 | * @return \Illuminate\Http\Response |
||
156 | */ |
||
157 | public function loginSocial(LoginSocial $request) |
||
163 | |||
164 | /** |
||
165 | * Assign the given groups to the given user. |
||
166 | * |
||
167 | * @param AssignGroups $request |
||
168 | * @return \Illuminate\Http\Response |
||
169 | */ |
||
170 | public function assignGroups(AssignGroups $request) |
||
174 | |||
175 | /** |
||
176 | * Send a reset link to the given user. |
||
177 | * |
||
178 | * @param SendReset $request |
||
179 | * @return \Illuminate\Http\Response |
||
180 | */ |
||
181 | public function sendReset(SendReset $request) |
||
185 | |||
186 | /** |
||
187 | * Reset the given user's password. |
||
188 | * |
||
189 | * @param ResetPassword $request |
||
190 | * @return \Illuminate\Http\Response |
||
191 | */ |
||
192 | public function resetPassword(ResetPassword $request) |
||
196 | |||
197 | /** |
||
198 | * Change the logged in user password. |
||
199 | * |
||
200 | * @param ChangePassword $request |
||
201 | * @return \Illuminate\Http\Response |
||
202 | */ |
||
203 | public function changePassword(ChangePassword $request) |
||
207 | |||
208 | /** |
||
209 | * Confirm email using the confirmation code. |
||
210 | * |
||
211 | * @param ConfirmEmail $request |
||
212 | * @return \Illuminate\Http\Response |
||
213 | */ |
||
214 | public function confirmEmail(ConfirmEmail $request) |
||
218 | |||
219 | /** |
||
220 | * Resend the email confirmation mail. |
||
221 | * |
||
222 | * @param ResendEmailConfirmation $request |
||
223 | * @return \Illuminate\Http\Response |
||
224 | */ |
||
225 | public function resendEmailConfirmation(ResendEmailConfirmation $request) |
||
229 | |||
230 | /** |
||
231 | * Refresh the expired login token. |
||
232 | * |
||
233 | * @param RefreshToken $request |
||
234 | * @return \Illuminate\Http\Response |
||
235 | */ |
||
236 | public function refreshToken(RefreshToken $request) |
||
240 | |||
241 | /** |
||
242 | * Paginate all users with in the given group. |
||
243 | * |
||
244 | * @param Request $request |
||
245 | * @param string $groupName The name of the requested group. |
||
246 | * @return \Illuminate\Http\Response |
||
247 | */ |
||
248 | public function group(Request $request, $groupName) |
||
252 | |||
253 | /** |
||
254 | * Save the given data to the logged in user. |
||
255 | * |
||
256 | * @param SaveProfile $request |
||
257 | * @return \Illuminate\Http\Response |
||
258 | */ |
||
259 | public function saveProfile(SaveProfile $request) |
||
263 | } |
||
264 |
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.