@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function boot() |
| 36 | 36 | { |
| 37 | - $this->app[Auth::class]->extend('jwt', function ($app) { |
|
| 37 | + $this->app[Auth::class]->extend('jwt', function($app) { |
|
| 38 | 38 | return new JWT($app['Tymon\JWTAuth\JWTAuth']); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -35,14 +35,14 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function boot() |
| 37 | 37 | { |
| 38 | - $this->app[Auth::class]->extend('oauth', function ($app) { |
|
| 38 | + $this->app[Auth::class]->extend('oauth', function($app) { |
|
| 39 | 39 | $provider = new OAuth2($app['oauth2-server.authorizer']->getChecker()); |
| 40 | 40 | |
| 41 | - $provider->setUserResolver(function ($id) { |
|
| 41 | + $provider->setUserResolver(function($id) { |
|
| 42 | 42 | return User::findOrFail($id); |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - $provider->setClientResolver(function ($id) { |
|
| 45 | + $provider->setClientResolver(function($id) { |
|
| 46 | 46 | return User::findOrFail($id); |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $api = app(Router::class); |
| 26 | 26 | $response = app(Dingo\Api\Http\Response\Factory::class); |
| 27 | 27 | |
| 28 | -app(Dingo\Api\Exception\Handler::class)->register(function (ModelNotFoundException $e) use ($response) { |
|
| 28 | +app(Dingo\Api\Exception\Handler::class)->register(function(ModelNotFoundException $e) use ($response) { |
|
| 29 | 29 | $response_array = [ |
| 30 | 30 | 'message' => '422 Unprocessable Entity', |
| 31 | 31 | 'status_code' => 422, |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | 37 | // Version 1 of our API |
| 38 | -$api->version('v1', function (Router $api) { |
|
| 38 | +$api->version('v1', function(Router $api) { |
|
| 39 | 39 | |
| 40 | 40 | // Set our namespace for the underlying routes |
| 41 | 41 | $api->group([ |
@@ -46,21 +46,21 @@ discard block |
||
| 46 | 46 | ], |
| 47 | 47 | 'limit' => 200, |
| 48 | 48 | 'expires' => 5, |
| 49 | - ], function (Router $api) { |
|
| 49 | + ], function(Router $api) { |
|
| 50 | 50 | |
| 51 | - $api->post('oauth/access-token','Auth\OAuth\Controller@accessToken'); |
|
| 51 | + $api->post('oauth/access-token', 'Auth\OAuth\Controller@accessToken'); |
|
| 52 | 52 | |
| 53 | 53 | // Login route |
| 54 | - $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 54 | + $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 55 | 55 | $api->post('register', 'Auth\AuthController@register'); |
| 56 | 56 | |
| 57 | 57 | $api->get('auth/refresh', 'Auth\AuthController@token'); |
| 58 | 58 | |
| 59 | 59 | // All routes in here are protected and thus need a valid token |
| 60 | - $api->group(['protected' => true, 'middleware' => 'api.auth'], function (Router $api) { |
|
| 60 | + $api->group(['protected' => true, 'middleware' => 'api.auth'], function(Router $api) { |
|
| 61 | 61 | |
| 62 | 62 | // Authentication |
| 63 | - $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 63 | + $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 64 | 64 | $api->get('users/me', 'Auth\AuthController@me'); |
| 65 | 65 | $api->post('sidebar', 'Auth\AuthController@sidebar'); |
| 66 | 66 | |
@@ -68,27 +68,27 @@ discard block |
||
| 68 | 68 | $api->get('employee/{employee}', 'EmployeeController@show'); |
| 69 | 69 | |
| 70 | 70 | // Profile |
| 71 | - $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function (Router $api) { |
|
| 72 | - $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 71 | + $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function(Router $api) { |
|
| 72 | + $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 73 | 73 | |
| 74 | - $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 74 | + $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 75 | 75 | |
| 76 | - $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 77 | - $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 78 | - $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 76 | + $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 77 | + $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 78 | + $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 79 | 79 | |
| 80 | - $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 81 | - $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 82 | - $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 80 | + $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 81 | + $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 82 | + $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 83 | 83 | |
| 84 | - $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 85 | - $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 86 | - $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 84 | + $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 85 | + $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 86 | + $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 87 | 87 | |
| 88 | 88 | $api->patch('job', 'JobController@update'); |
| 89 | 89 | $api->delete('job/{job_history}', 'JobController@destroy'); |
| 90 | 90 | |
| 91 | - $api->group(['prefix' => 'qualifications'], function (Router $api) { |
|
| 91 | + $api->group(['prefix' => 'qualifications'], function(Router $api) { |
|
| 92 | 92 | $api->post('work-experiences', 'QualificationsController@storeWorkExperience'); |
| 93 | 93 | $api->delete('work-experiences/{work_experience}', 'QualificationsController@destroyWorkExperience'); |
| 94 | 94 | $api->patch('work-experiences', 'QualificationsController@updateWorkExperience'); |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | 106 | // PIM |
| 107 | - $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function (Router $api) { |
|
| 107 | + $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function(Router $api) { |
|
| 108 | 108 | $api->get('employee-list', 'EmployeeListController@index'); |
| 109 | 109 | |
| 110 | 110 | // Configuration |
| 111 | - $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function (Router $api) { |
|
| 112 | - $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 113 | - $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 114 | - $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 115 | - $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 111 | + $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function(Router $api) { |
|
| 112 | + $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 113 | + $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 114 | + $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 115 | + $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 116 | 116 | $api->delete('termination-reasons/{termination_reason}', 'TerminationReasonsController@destroy'); // docs done |
| 117 | 117 | |
| 118 | 118 | $api->get('custom-field-sections', 'CustomFieldsController@index'); |
@@ -129,41 +129,41 @@ discard block |
||
| 129 | 129 | }); |
| 130 | 130 | |
| 131 | 131 | // Admin |
| 132 | - $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function (Router $api) { |
|
| 132 | + $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function(Router $api) { |
|
| 133 | 133 | |
| 134 | 134 | // Job |
| 135 | - $api->group(['prefix' => 'job', 'namespace' => 'Job'], function (Router $api) { |
|
| 136 | - $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 137 | - $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 138 | - $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 139 | - $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 140 | - $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 141 | - |
|
| 142 | - $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 143 | - $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 144 | - $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 145 | - $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 146 | - $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 147 | - |
|
| 148 | - $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 149 | - $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 150 | - $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 151 | - $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 152 | - $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 135 | + $api->group(['prefix' => 'job', 'namespace' => 'Job'], function(Router $api) { |
|
| 136 | + $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 137 | + $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 138 | + $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 139 | + $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 140 | + $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 141 | + |
|
| 142 | + $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 143 | + $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 144 | + $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 145 | + $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 146 | + $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 147 | + |
|
| 148 | + $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 149 | + $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 150 | + $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 151 | + $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 152 | + $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 153 | 153 | }); |
| 154 | 154 | |
| 155 | 155 | // Qualification |
| 156 | - $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function (Router $api) { |
|
| 157 | - $api->get('educations', 'EducationsController@index'); // docs done |
|
| 158 | - $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 159 | - $api->post('educations', 'EducationsController@store'); // docs done |
|
| 160 | - $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 161 | - $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 156 | + $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function(Router $api) { |
|
| 157 | + $api->get('educations', 'EducationsController@index'); // docs done |
|
| 158 | + $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 159 | + $api->post('educations', 'EducationsController@store'); // docs done |
|
| 160 | + $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 161 | + $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 162 | 162 | }); |
| 163 | 163 | }); |
| 164 | 164 | |
| 165 | 165 | // Presence |
| 166 | - $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function (Router $api) { |
|
| 166 | + $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function(Router $api) { |
|
| 167 | 167 | $api->get('timelogs', 'TimelogController@index'); |
| 168 | 168 | $api->get('alert/time-in', 'TimelogController@attemptTimeIn'); |
| 169 | 169 | $api->get('alert/time-out', 'TimelogController@attemptTimeOut'); |
@@ -173,20 +173,20 @@ discard block |
||
| 173 | 173 | }); |
| 174 | 174 | |
| 175 | 175 | // Chosen |
| 176 | - $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 177 | - $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 178 | - $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 179 | - $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 180 | - $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 181 | - $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 182 | - $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 183 | - $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 184 | - $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 185 | - $api->get('types', 'LookupTableController@types'); // docs done |
|
| 186 | - $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 187 | - $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 188 | - $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 189 | - $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 176 | + $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 177 | + $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 178 | + $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 179 | + $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 180 | + $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 181 | + $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 182 | + $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 183 | + $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 184 | + $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 185 | + $api->get('types', 'LookupTableController@types'); // docs done |
|
| 186 | + $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 187 | + $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 188 | + $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 189 | + $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 190 | 190 | }); |
| 191 | 191 | |
| 192 | 192 | $api->get('playground', 'PlaygroundController@index'); |