@@ -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,20 +46,20 @@ discard block |
||
| 46 | 46 | ], |
| 47 | 47 | 'limit' => 200, |
| 48 | 48 | 'expires' => 5, |
| 49 | - ], function (Router $api) { |
|
| 49 | + ], function(Router $api) { |
|
| 50 | 50 | $api->get('/', 'BaseController@apiInformation'); |
| 51 | 51 | |
| 52 | 52 | // Login route |
| 53 | - $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 53 | + $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 54 | 54 | $api->post('register', 'Auth\AuthController@register'); |
| 55 | 55 | |
| 56 | 56 | $api->get('auth/refresh', 'Auth\AuthController@token'); |
| 57 | 57 | |
| 58 | 58 | // All routes in here are protected and thus need a valid token |
| 59 | - $api->group(['protected' => true, 'middleware' => 'api.auth'], function (Router $api) { |
|
| 59 | + $api->group(['protected' => true, 'middleware' => 'api.auth'], function(Router $api) { |
|
| 60 | 60 | |
| 61 | 61 | // Authentication |
| 62 | - $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 62 | + $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 63 | 63 | $api->get('users/me', 'Auth\AuthController@me'); |
| 64 | 64 | $api->post('sidebar', 'Auth\AuthController@sidebar'); |
| 65 | 65 | |
@@ -67,27 +67,27 @@ discard block |
||
| 67 | 67 | $api->get('employee/{employee}', 'EmployeeController@show'); |
| 68 | 68 | |
| 69 | 69 | // Profile |
| 70 | - $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function (Router $api) { |
|
| 71 | - $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 70 | + $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function(Router $api) { |
|
| 71 | + $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 72 | 72 | |
| 73 | - $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 73 | + $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 74 | 74 | |
| 75 | - $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 76 | - $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 77 | - $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 75 | + $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 76 | + $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 77 | + $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 78 | 78 | |
| 79 | - $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 80 | - $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 81 | - $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 79 | + $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 80 | + $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 81 | + $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 82 | 82 | |
| 83 | - $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 84 | - $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 85 | - $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 83 | + $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 84 | + $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 85 | + $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 86 | 86 | |
| 87 | 87 | $api->patch('job', 'JobController@update'); |
| 88 | 88 | $api->delete('job/{job_history}', 'JobController@destroy'); |
| 89 | 89 | |
| 90 | - $api->group(['prefix' => 'qualifications'], function (Router $api) { |
|
| 90 | + $api->group(['prefix' => 'qualifications'], function(Router $api) { |
|
| 91 | 91 | $api->post('work-experiences', 'QualificationsController@storeWorkExperience'); |
| 92 | 92 | $api->delete('work-experiences/{work_experience}', 'QualificationsController@destroyWorkExperience'); |
| 93 | 93 | $api->patch('work-experiences', 'QualificationsController@updateWorkExperience'); |
@@ -103,15 +103,15 @@ discard block |
||
| 103 | 103 | }); |
| 104 | 104 | |
| 105 | 105 | // PIM |
| 106 | - $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function (Router $api) { |
|
| 106 | + $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function(Router $api) { |
|
| 107 | 107 | $api->get('employee-list', 'EmployeeListController@index'); |
| 108 | 108 | |
| 109 | 109 | // Configuration |
| 110 | - $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function (Router $api) { |
|
| 111 | - $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 112 | - $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 113 | - $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 114 | - $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 110 | + $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function(Router $api) { |
|
| 111 | + $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 112 | + $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 113 | + $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 114 | + $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 115 | 115 | $api->delete('termination-reasons/{termination_reason}', 'TerminationReasonsController@destroy'); // docs done |
| 116 | 116 | |
| 117 | 117 | $api->get('custom-field-sections', 'CustomFieldsController@index'); |
@@ -128,41 +128,41 @@ discard block |
||
| 128 | 128 | }); |
| 129 | 129 | |
| 130 | 130 | // Admin |
| 131 | - $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function (Router $api) { |
|
| 131 | + $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function(Router $api) { |
|
| 132 | 132 | |
| 133 | 133 | // Job |
| 134 | - $api->group(['prefix' => 'job', 'namespace' => 'Job'], function (Router $api) { |
|
| 135 | - $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 136 | - $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 137 | - $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 138 | - $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 139 | - $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 140 | - |
|
| 141 | - $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 142 | - $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 143 | - $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 144 | - $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 145 | - $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 146 | - |
|
| 147 | - $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 148 | - $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 149 | - $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 150 | - $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 151 | - $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 134 | + $api->group(['prefix' => 'job', 'namespace' => 'Job'], function(Router $api) { |
|
| 135 | + $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 136 | + $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 137 | + $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 138 | + $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 139 | + $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 140 | + |
|
| 141 | + $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 142 | + $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 143 | + $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 144 | + $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 145 | + $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 146 | + |
|
| 147 | + $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 148 | + $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 149 | + $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 150 | + $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 151 | + $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 152 | 152 | }); |
| 153 | 153 | |
| 154 | 154 | // Qualification |
| 155 | - $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function (Router $api) { |
|
| 156 | - $api->get('educations', 'EducationsController@index'); // docs done |
|
| 157 | - $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 158 | - $api->post('educations', 'EducationsController@store'); // docs done |
|
| 159 | - $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 160 | - $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 155 | + $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function(Router $api) { |
|
| 156 | + $api->get('educations', 'EducationsController@index'); // docs done |
|
| 157 | + $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 158 | + $api->post('educations', 'EducationsController@store'); // docs done |
|
| 159 | + $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 160 | + $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 161 | 161 | }); |
| 162 | 162 | }); |
| 163 | 163 | |
| 164 | 164 | // Presence |
| 165 | - $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function (Router $api) { |
|
| 165 | + $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function(Router $api) { |
|
| 166 | 166 | $api->get('timelogs', 'TimelogController@index'); |
| 167 | 167 | $api->get('alert/time-in', 'TimelogController@attemptTimeIn'); |
| 168 | 168 | $api->get('alert/time-out', 'TimelogController@attemptTimeOut'); |
@@ -172,20 +172,20 @@ discard block |
||
| 172 | 172 | }); |
| 173 | 173 | |
| 174 | 174 | // Chosen |
| 175 | - $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 176 | - $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 177 | - $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 178 | - $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 179 | - $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 180 | - $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 181 | - $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 182 | - $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 183 | - $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 184 | - $api->get('types', 'LookupTableController@types'); // docs done |
|
| 185 | - $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 186 | - $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 187 | - $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 188 | - $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 175 | + $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 176 | + $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 177 | + $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 178 | + $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 179 | + $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 180 | + $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 181 | + $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 182 | + $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 183 | + $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 184 | + $api->get('types', 'LookupTableController@types'); // docs done |
|
| 185 | + $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 186 | + $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 187 | + $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 188 | + $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 189 | 189 | }); |
| 190 | 190 | |
| 191 | 191 | $api->get('playground', 'PlaygroundController@index'); |