1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
Route::group([ 'prefix' => 'api/v1', 'middleware' => ['api','bindings','throttle']], function () { |
4
|
|
|
Route::group(['middleware' => 'auth:api'], function() { |
5
|
|
|
|
6
|
|
|
//USER |
7
|
|
|
Route::get('/user', 'APILoggedUserController@index'); |
8
|
|
|
Route::put('/user', 'APILoggedUserController@update'); |
9
|
|
|
|
10
|
|
|
//User password: |
11
|
|
|
Route::put('/user/password', 'APILoggedUserPasswordController@update'); |
12
|
|
|
|
13
|
|
|
//User name |
14
|
|
|
Route::put('/user/name', 'APILoggedUserNameController@update'); |
15
|
|
|
|
16
|
|
|
//User email |
17
|
|
|
Route::put('/user/email', 'APILoggedUserEmailController@update'); |
18
|
|
|
|
19
|
|
|
//USERS |
20
|
|
|
Route::get('/users', 'APIFullUsersController@index'); |
21
|
|
|
Route::post('/users', 'APIFullUsersController@store'); |
22
|
|
|
Route::get('/users/{User}', 'APIFullUsersController@show'); |
23
|
|
|
Route::post('/users-massive', 'APIFullUsersController@massiveDestroy'); |
24
|
|
|
Route::put('/users/{User}', 'APIFullUsersController@update'); |
25
|
|
|
Route::delete('/users/{User}', 'APIFullUsersController@destroy'); |
26
|
|
|
|
27
|
|
|
//USER INVITATIONS |
28
|
|
|
Route::get('/users-invitations', 'UserInvitationsController@index'); |
29
|
|
|
//Send and store are the same: emails are sent when new user invitation is stored in database using eloquent events |
30
|
|
|
Route::post('/users-invitations/send', 'UserInvitationsController@sendInvitation'); |
31
|
|
|
Route::post('/users-invitations', 'UserInvitationsController@store'); |
32
|
|
|
|
33
|
|
|
Route::get('/users-invitations/{UserInvitation}', 'UserInvitationsController@show'); |
34
|
|
|
Route::delete('/users-invitations/{UserInvitation}', 'UserInvitationsController@destroy'); |
35
|
|
|
Route::put('/users-invitations/{UserInvitation}', 'UserInvitationsController@update'); |
36
|
|
|
|
37
|
|
|
//USERS DASHBOARD |
38
|
|
|
Route::get('/users-dashboard/totalUsers', 'UsersDashboardController@totalUsers'); |
39
|
|
|
|
40
|
|
|
//USERS Tracking |
41
|
|
|
Route::get('/revisionable/model/tracking', 'RevisionableController@trackModel'); |
42
|
|
|
|
43
|
|
|
//Users profile |
44
|
|
|
Route::get('/user/profile/{user?}', 'UserProfileController@show'); |
45
|
|
|
|
46
|
|
|
//User reset password email |
47
|
|
|
Route::post('/users/send/reset-password-email', |
48
|
|
|
'APIForgotPasswordController@sendResetLinkEmail'); |
49
|
|
|
// Route::post('/users/send/reset-password-email', |
|
|
|
|
50
|
|
|
// '\App\Http\Controllers\Auth\NoGuestForgotPasswordController@sendResetLinkEmail'); |
51
|
|
|
Route::post('/users/send/reset-password-email/massive', |
52
|
|
|
'APIForgotPasswordController@massiveSendResetLinkEmail'); |
53
|
|
|
|
54
|
|
|
//Google apps |
55
|
|
|
Route::get('/users-google/check', 'GoogleAppsUsersController@check'); |
56
|
|
|
Route::get('/users-google/local-sync', 'GoogleAppsUsersController@localSync'); |
57
|
|
|
|
58
|
|
|
Route::get('/users-google', 'GoogleAppsUsersController@all'); |
59
|
|
|
|
60
|
|
|
}); |
61
|
|
|
|
62
|
|
|
Route::post('/user-invitations-accept', 'UserInvitationsController@postAccept'); |
63
|
|
|
if (config('users.users_can_invite_other_users')) { |
64
|
|
|
Route::post('/invite/user', 'UserInvitationsController@sendInvitation'); |
65
|
|
|
} |
66
|
|
|
}); |
67
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.