@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $api = app(Router::class); |
| 14 | 14 | $response = app(Dingo\Api\Http\Response\Factory::class); |
| 15 | 15 | |
| 16 | -app(Dingo\Api\Exception\Handler::class)->register(function (ModelNotFoundException $e) use ($response) { |
|
| 16 | +app(Dingo\Api\Exception\Handler::class)->register(function(ModelNotFoundException $e) use ($response) { |
|
| 17 | 17 | $response_array = [ |
| 18 | 18 | 'message' => '422 Unprocessable Entity', |
| 19 | 19 | 'status_code' => 422, |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | 25 | // Version 1 of our API |
| 26 | -$api->version('v1', function (Router $api) { |
|
| 26 | +$api->version('v1', function(Router $api) { |
|
| 27 | 27 | |
| 28 | 28 | // Set our namespace for the underlying routes |
| 29 | 29 | $api->group([ |
@@ -34,20 +34,20 @@ discard block |
||
| 34 | 34 | ], |
| 35 | 35 | 'limit' => 200, |
| 36 | 36 | 'expires' => 5, |
| 37 | - ], function (Router $api) { |
|
| 37 | + ], function(Router $api) { |
|
| 38 | 38 | $api->get('/', 'BaseController@apiInformation'); |
| 39 | 39 | |
| 40 | 40 | // Login route |
| 41 | - $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 41 | + $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 42 | 42 | $api->post('register', 'Auth\AuthController@register'); |
| 43 | 43 | |
| 44 | 44 | $api->get('auth/refresh', 'Auth\AuthController@token'); |
| 45 | 45 | |
| 46 | 46 | // All routes in here are protected and thus need a valid token |
| 47 | - $api->group(['protected' => true, 'middleware' => 'jwt.auth'], function (Router $api) { |
|
| 47 | + $api->group(['protected' => true, 'middleware' => 'jwt.auth'], function(Router $api) { |
|
| 48 | 48 | |
| 49 | 49 | // Authentication |
| 50 | - $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 50 | + $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 51 | 51 | $api->get('users/me', 'Auth\AuthController@me'); |
| 52 | 52 | $api->post('sidebar', 'Auth\AuthController@sidebar'); |
| 53 | 53 | |
@@ -55,27 +55,27 @@ discard block |
||
| 55 | 55 | $api->get('employee/{employee}', 'EmployeeController@show'); |
| 56 | 56 | |
| 57 | 57 | // Profile |
| 58 | - $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function (Router $api) { |
|
| 59 | - $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 58 | + $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function(Router $api) { |
|
| 59 | + $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 60 | 60 | |
| 61 | - $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 61 | + $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 62 | 62 | |
| 63 | - $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 64 | - $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 65 | - $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 63 | + $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 64 | + $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 65 | + $api->delete('emergency-contacts/{emergency_contact}', 'EmergencyContactsController@destroy'); // docs done |
|
| 66 | 66 | |
| 67 | - $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 68 | - $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 69 | - $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 67 | + $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 68 | + $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 69 | + $api->delete('dependents/{dependent}', 'DependentsController@destroy'); // docs done |
|
| 70 | 70 | |
| 71 | - $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 72 | - $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 73 | - $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 71 | + $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 72 | + $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 73 | + $api->delete('reports-to/{employee_supervisor}', 'ReportsToController@destroy'); // docs done |
|
| 74 | 74 | |
| 75 | 75 | $api->patch('job', 'JobController@update'); |
| 76 | 76 | $api->delete('job/{job_history}', 'JobController@destroy'); |
| 77 | 77 | |
| 78 | - $api->group(['prefix' => 'qualifications'], function (Router $api) { |
|
| 78 | + $api->group(['prefix' => 'qualifications'], function(Router $api) { |
|
| 79 | 79 | $api->post('work-experiences', 'QualificationsController@storeWorkExperience'); |
| 80 | 80 | $api->delete('work-experiences/{work_experience}', 'QualificationsController@destroyWorkExperience'); |
| 81 | 81 | $api->patch('work-experiences', 'QualificationsController@updateWorkExperience'); |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | }); |
| 92 | 92 | |
| 93 | 93 | // PIM |
| 94 | - $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function (Router $api) { |
|
| 94 | + $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function(Router $api) { |
|
| 95 | 95 | $api->get('employee-list', 'EmployeeListController@index'); |
| 96 | 96 | |
| 97 | 97 | // Configuration |
| 98 | - $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function (Router $api) { |
|
| 99 | - $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 100 | - $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 101 | - $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 102 | - $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 98 | + $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function(Router $api) { |
|
| 99 | + $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 100 | + $api->get('termination-reasons/{termination_reason}', 'TerminationReasonsController@show'); // docs done |
|
| 101 | + $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 102 | + $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 103 | 103 | $api->delete('termination-reasons/{termination_reason}', 'TerminationReasonsController@destroy'); // docs done |
| 104 | 104 | |
| 105 | 105 | $api->get('custom-field-sections', 'CustomFieldsController@index'); |
@@ -116,41 +116,41 @@ discard block |
||
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | 118 | // Admin |
| 119 | - $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function (Router $api) { |
|
| 119 | + $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function(Router $api) { |
|
| 120 | 120 | |
| 121 | 121 | // Job |
| 122 | - $api->group(['prefix' => 'job', 'namespace' => 'Job'], function (Router $api) { |
|
| 123 | - $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 124 | - $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 125 | - $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 126 | - $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 127 | - $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 128 | - |
|
| 129 | - $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 130 | - $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 131 | - $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 132 | - $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 133 | - $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 134 | - |
|
| 135 | - $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 136 | - $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 137 | - $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 138 | - $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 139 | - $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 122 | + $api->group(['prefix' => 'job', 'namespace' => 'Job'], function(Router $api) { |
|
| 123 | + $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 124 | + $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 125 | + $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 126 | + $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 127 | + $api->delete('titles/{job_title}', 'JobTitlesController@destroy'); // docs done |
|
| 128 | + |
|
| 129 | + $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 130 | + $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 131 | + $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 132 | + $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 133 | + $api->delete('employment-status/{employment_status}', 'EmploymentStatusController@destroy'); // docs done |
|
| 134 | + |
|
| 135 | + $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 136 | + $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 137 | + $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 138 | + $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 139 | + $api->delete('pay-grades/{pay_grade}', 'PayGradesController@destroy'); // docs done |
|
| 140 | 140 | }); |
| 141 | 141 | |
| 142 | 142 | // Qualification |
| 143 | - $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function (Router $api) { |
|
| 144 | - $api->get('educations', 'EducationsController@index'); // docs done |
|
| 145 | - $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 146 | - $api->post('educations', 'EducationsController@store'); // docs done |
|
| 147 | - $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 148 | - $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 143 | + $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function(Router $api) { |
|
| 144 | + $api->get('educations', 'EducationsController@index'); // docs done |
|
| 145 | + $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 146 | + $api->post('educations', 'EducationsController@store'); // docs done |
|
| 147 | + $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 148 | + $api->delete('educations/{education_level}', 'EducationsController@destroy'); // docs done |
|
| 149 | 149 | }); |
| 150 | 150 | }); |
| 151 | 151 | |
| 152 | 152 | // Presence |
| 153 | - $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function (Router $api) { |
|
| 153 | + $api->group(['prefix' => 'presence', 'namespace' => 'Presence'], function(Router $api) { |
|
| 154 | 154 | $api->get('timelogs', 'TimelogController@index'); |
| 155 | 155 | $api->get('alert/time-in', 'TimelogController@attemptTimeIn'); |
| 156 | 156 | $api->get('alert/time-out', 'TimelogController@attemptTimeOut'); |
@@ -160,20 +160,20 @@ discard block |
||
| 160 | 160 | }); |
| 161 | 161 | |
| 162 | 162 | // Chosen |
| 163 | - $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 164 | - $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 165 | - $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 166 | - $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 167 | - $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 168 | - $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 169 | - $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 170 | - $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 171 | - $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 172 | - $api->get('types', 'LookupTableController@types'); // docs done |
|
| 173 | - $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 174 | - $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 175 | - $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 176 | - $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 163 | + $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 164 | + $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 165 | + $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 166 | + $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 167 | + $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 168 | + $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 169 | + $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 170 | + $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 171 | + $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 172 | + $api->get('types', 'LookupTableController@types'); // docs done |
|
| 173 | + $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 174 | + $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 175 | + $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 176 | + $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 177 | 177 | }); |
| 178 | 178 | |
| 179 | 179 | $api->get('playground', 'PlaygroundController@index'); |