@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * @param $model |
| 210 | - * @param null $custom_attribute |
|
| 210 | + * @param string $custom_attribute |
|
| 211 | 211 | * |
| 212 | 212 | * @return \Illuminate\Http\JsonResponse |
| 213 | 213 | * |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | 226 | * @param $model |
| 227 | - * @param null $custom_attribute |
|
| 227 | + * @param string[] $custom_attribute |
|
| 228 | 228 | * |
| 229 | 229 | * @return \Illuminate\Http\JsonResponse |
| 230 | 230 | * |
@@ -353,7 +353,7 @@ |
||
| 353 | 353 | |
| 354 | 354 | $custom_field_sections = $this->custom_field_section->with('customFields.options')->whereScreenId($screen_id)->get(); |
| 355 | 355 | |
| 356 | - $custom_field_sections->each(function ($custom_field_section) { |
|
| 356 | + $custom_field_sections->each(function($custom_field_section) { |
|
| 357 | 357 | $custom_fields = $custom_field_section->customFields; |
| 358 | 358 | |
| 359 | 359 | $custom_field_section->fields = array_chunk($custom_fields->toArray(), 2); |
@@ -213,7 +213,7 @@ |
||
| 213 | 213 | /** |
| 214 | 214 | * Setup table for custom field section. |
| 215 | 215 | * |
| 216 | - * @param $custom_field_sections |
|
| 216 | + * @param \Illuminate\Pagination\LengthAwarePaginator $custom_field_sections |
|
| 217 | 217 | * |
| 218 | 218 | * @return array |
| 219 | 219 | * |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | { |
| 407 | 407 | $parent_links = self::where('parent_id', 0)->get(); |
| 408 | 408 | |
| 409 | - $parent_links->each(function ($item) { |
|
| 409 | + $parent_links->each(function($item) { |
|
| 410 | 410 | $item->route = str_replace('/', '-', $item->href); |
| 411 | 411 | })->toArray(); |
| 412 | 412 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | foreach ($children as $k => $child) { |
| 429 | 429 | $grand_children = self::where('parent_id', $child['id'])->get(); |
| 430 | 430 | |
| 431 | - $grand_children->each(function ($item) { |
|
| 431 | + $grand_children->each(function($item) { |
|
| 432 | 432 | $item->route = str_replace('/', '-', $item->href); |
| 433 | 433 | })->toArray(); |
| 434 | 434 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | private static function filterPermission($user, $links) |
| 452 | 452 | { |
| 453 | - return $links->filter(function (Navlink $item) use ($user) { |
|
| 453 | + return $links->filter(function(Navlink $item) use ($user) { |
|
| 454 | 454 | $permission = str_replace('/', '.', $item->href); |
| 455 | 455 | |
| 456 | 456 | return $user->hasAccess($permission.'.view'); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function map(Router $router) |
| 40 | 40 | { |
| 41 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 41 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
| 42 | 42 | require app_path('Http/routes.php'); |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | /** |
| 57 | 57 | * Check if logged user has access. |
| 58 | 58 | * |
| 59 | - * @param $permission |
|
| 59 | + * @param string $permission |
|
| 60 | 60 | * @return bool |
| 61 | 61 | */ |
| 62 | 62 | public function hasAccess($permission) |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $api = app(Router::class); |
| 13 | 13 | |
| 14 | 14 | // Version 1 of our API |
| 15 | -$api->version('v1', function (Router $api) { |
|
| 15 | +$api->version('v1', function(Router $api) { |
|
| 16 | 16 | |
| 17 | 17 | // Set our namespace for the underlying routes |
| 18 | 18 | $api->group([ |
@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | 'api.throttle', |
| 23 | 23 | ], |
| 24 | 24 | 'limit' => 200, |
| 25 | - 'expires' => 5, ], function (Router $api) { |
|
| 25 | + 'expires' => 5, ], function(Router $api) { |
|
| 26 | 26 | |
| 27 | 27 | // Login route |
| 28 | - $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 28 | + $api->post('login', 'Auth\AuthController@authenticate'); // docs done |
|
| 29 | 29 | $api->post('register', 'Auth\AuthController@register'); |
| 30 | 30 | |
| 31 | 31 | $api->get('auth/refresh', 'Auth\AuthController@token'); |
| 32 | 32 | |
| 33 | 33 | // All routes in here are protected and thus need a valid token |
| 34 | - $api->group(['protected' => true, 'middleware' => 'jwt.auth'], function (Router $api) { |
|
| 34 | + $api->group(['protected' => true, 'middleware' => 'jwt.auth'], function(Router $api) { |
|
| 35 | 35 | |
| 36 | 36 | // Authentication |
| 37 | - $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 37 | + $api->get('logout', 'Auth\AuthController@logout'); // docs done |
|
| 38 | 38 | $api->get('users/me', 'Auth\AuthController@me'); |
| 39 | 39 | $api->post('sidebar', 'Auth\AuthController@sidebar'); |
| 40 | 40 | |
@@ -42,27 +42,27 @@ discard block |
||
| 42 | 42 | $api->get('employee/{employee}', 'EmployeeController@show'); |
| 43 | 43 | |
| 44 | 44 | // Profile |
| 45 | - $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function (Router $api) { |
|
| 46 | - $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 45 | + $api->group(['prefix' => 'profile', 'namespace' => 'Profile'], function(Router $api) { |
|
| 46 | + $api->patch('personal-details', 'PersonalDetailsController@update'); // docs done |
|
| 47 | 47 | |
| 48 | - $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 48 | + $api->patch('contact-details', 'PersonalDetailsController@update'); // docs done |
|
| 49 | 49 | |
| 50 | - $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 51 | - $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 52 | - $api->delete('emergency-contacts', 'EmergencyContactsController@destroy'); // docs done |
|
| 50 | + $api->post('emergency-contacts', 'EmergencyContactsController@store'); // docs done |
|
| 51 | + $api->patch('emergency-contacts', 'EmergencyContactsController@update'); // docs done |
|
| 52 | + $api->delete('emergency-contacts', 'EmergencyContactsController@destroy'); // docs done |
|
| 53 | 53 | |
| 54 | - $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 55 | - $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 56 | - $api->delete('dependents', 'DependentsController@destroy'); // docs done |
|
| 54 | + $api->post('dependents', 'DependentsController@store'); // docs done |
|
| 55 | + $api->patch('dependents', 'DependentsController@update'); // docs done |
|
| 56 | + $api->delete('dependents', 'DependentsController@destroy'); // docs done |
|
| 57 | 57 | |
| 58 | - $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 59 | - $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 60 | - $api->delete('reports-to', 'ReportsToController@destroy'); // docs done |
|
| 58 | + $api->post('reports-to', 'ReportsToController@store'); // docs done |
|
| 59 | + $api->patch('reports-to', 'ReportsToController@update'); // docs done |
|
| 60 | + $api->delete('reports-to', 'ReportsToController@destroy'); // docs done |
|
| 61 | 61 | |
| 62 | 62 | $api->patch('job', 'JobController@update'); |
| 63 | 63 | $api->delete('job', 'JobController@destroy'); |
| 64 | 64 | |
| 65 | - $api->group(['prefix' => 'qualifications'], function (Router $api) { |
|
| 65 | + $api->group(['prefix' => 'qualifications'], function(Router $api) { |
|
| 66 | 66 | $api->post('work-experiences', 'QualificationsController@storeWorkExperience'); |
| 67 | 67 | $api->delete('work-experiences', 'QualificationsController@destroyWorkExperience'); |
| 68 | 68 | $api->patch('work-experiences', 'QualificationsController@updateWorkExperience'); |
@@ -78,16 +78,16 @@ discard block |
||
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | 80 | // PIM |
| 81 | - $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function (Router $api) { |
|
| 81 | + $api->group(['prefix' => 'pim', 'namespace' => 'PIM'], function(Router $api) { |
|
| 82 | 82 | $api->get('employee-list', 'EmployeeListController@index'); |
| 83 | 83 | |
| 84 | 84 | // Configuration |
| 85 | - $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function (Router $api) { |
|
| 85 | + $api->group(['prefix' => 'configuration', 'namespace' => 'Configuration'], function(Router $api) { |
|
| 86 | 86 | |
| 87 | - $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 88 | - $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 89 | - $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 90 | - $api->delete('termination-reasons', 'TerminationReasonsController@destroy'); // docs done |
|
| 87 | + $api->get('termination-reasons', 'TerminationReasonsController@index'); // docs done |
|
| 88 | + $api->post('termination-reasons', 'TerminationReasonsController@store'); // docs done |
|
| 89 | + $api->patch('termination-reasons', 'TerminationReasonsController@update'); // docs done |
|
| 90 | + $api->delete('termination-reasons', 'TerminationReasonsController@destroy'); // docs done |
|
| 91 | 91 | |
| 92 | 92 | $api->get('custom-field-sections', 'CustomFieldsController@index'); |
| 93 | 93 | $api->post('custom-field-sections', 'CustomFieldsController@store'); |
@@ -103,54 +103,54 @@ discard block |
||
| 103 | 103 | }); |
| 104 | 104 | |
| 105 | 105 | // Admin |
| 106 | - $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function (Router $api) { |
|
| 106 | + $api->group(['prefix' => 'admin', 'namespace' => 'Admin'], function(Router $api) { |
|
| 107 | 107 | |
| 108 | 108 | // Job |
| 109 | - $api->group(['prefix' => 'job', 'namespace' => 'Job'], function (Router $api) { |
|
| 110 | - $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 111 | - $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 112 | - $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 113 | - $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 114 | - $api->delete('titles', 'JobTitlesController@destroy'); // docs done |
|
| 115 | - |
|
| 116 | - $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 117 | - $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 118 | - $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 119 | - $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 120 | - $api->delete('employment-status', 'EmploymentStatusController@destroy'); // docs done |
|
| 121 | - |
|
| 122 | - $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 123 | - $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 124 | - $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 125 | - $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 126 | - $api->delete('pay-grades', 'PayGradesController@destroy'); // docs done |
|
| 109 | + $api->group(['prefix' => 'job', 'namespace' => 'Job'], function(Router $api) { |
|
| 110 | + $api->get('titles', 'JobTitlesController@index'); // docs done |
|
| 111 | + $api->get('titles/{job_title}', 'JobTitlesController@show'); // docs done |
|
| 112 | + $api->post('titles', 'JobTitlesController@store'); // docs done |
|
| 113 | + $api->patch('titles', 'JobTitlesController@update'); // docs done |
|
| 114 | + $api->delete('titles', 'JobTitlesController@destroy'); // docs done |
|
| 115 | + |
|
| 116 | + $api->get('employment-status', 'EmploymentStatusController@index'); // docs done |
|
| 117 | + $api->get('employment-status/{employment_status}', 'EmploymentStatusController@show'); // docs done |
|
| 118 | + $api->post('employment-status', 'EmploymentStatusController@store'); // docs done |
|
| 119 | + $api->patch('employment-status', 'EmploymentStatusController@update'); // docs done |
|
| 120 | + $api->delete('employment-status', 'EmploymentStatusController@destroy'); // docs done |
|
| 121 | + |
|
| 122 | + $api->get('pay-grades', 'PayGradesController@index'); // docs done |
|
| 123 | + $api->get('pay-grades/{pay_grade}', 'PayGradesController@show'); // docs done |
|
| 124 | + $api->post('pay-grades', 'PayGradesController@store'); // docs done |
|
| 125 | + $api->patch('pay-grades', 'PayGradesController@update'); // docs done |
|
| 126 | + $api->delete('pay-grades', 'PayGradesController@destroy'); // docs done |
|
| 127 | 127 | }); |
| 128 | 128 | |
| 129 | 129 | // Qualification |
| 130 | - $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function (Router $api) { |
|
| 131 | - $api->get('educations', 'EducationsController@index'); // docs done |
|
| 132 | - $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 133 | - $api->post('educations', 'EducationsController@store'); // docs done |
|
| 134 | - $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 135 | - $api->delete('educations', 'EducationsController@destroy'); // docs done |
|
| 130 | + $api->group(['prefix' => 'qualifications', 'namespace' => 'Qualifications'], function(Router $api) { |
|
| 131 | + $api->get('educations', 'EducationsController@index'); // docs done |
|
| 132 | + $api->get('educations/{education_level}', 'EducationsController@show'); // docs done |
|
| 133 | + $api->post('educations', 'EducationsController@store'); // docs done |
|
| 134 | + $api->patch('educations', 'EducationsController@update'); // docs done |
|
| 135 | + $api->delete('educations', 'EducationsController@destroy'); // docs done |
|
| 136 | 136 | }); |
| 137 | 137 | }); |
| 138 | 138 | |
| 139 | 139 | // Chosen |
| 140 | - $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 141 | - $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 142 | - $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 143 | - $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 144 | - $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 145 | - $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 146 | - $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 147 | - $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 148 | - $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 149 | - $api->get('types', 'LookupTableController@types'); // docs done |
|
| 150 | - $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 151 | - $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 152 | - $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 153 | - $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 140 | + $api->get('cities', 'LookupTableController@cities'); // docs done |
|
| 141 | + $api->get('countries', 'LookupTableController@countries'); // docs done |
|
| 142 | + $api->get('departments', 'LookupTableController@departments'); // docs done |
|
| 143 | + $api->get('education-levels', 'LookupTableController@educationLevels'); // docs done |
|
| 144 | + $api->get('employment-statuses', 'LookupTableController@employmentStatuses'); // docs done |
|
| 145 | + $api->get('job-titles', 'LookupTableController@jobTitles'); // docs done |
|
| 146 | + $api->get('locations', 'LookupTableController@locations'); // docs done |
|
| 147 | + $api->get('marital-statuses', 'LookupTableController@maritalStatuses'); // docs done |
|
| 148 | + $api->get('screens', 'LookupTableController@screens'); // docs done |
|
| 149 | + $api->get('types', 'LookupTableController@types'); // docs done |
|
| 150 | + $api->get('nationalities', 'LookupTableController@nationalities'); // docs done |
|
| 151 | + $api->get('provinces', 'LookupTableController@provinces'); // docs done |
|
| 152 | + $api->get('relationships', 'LookupTableController@relationships'); // docs done |
|
| 153 | + $api->get('skills', 'LookupTableController@skills'); // docs done |
|
| 154 | 154 | }); |
| 155 | 155 | |
| 156 | 156 | }); |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $use_gravatar = config('company.use_gravatar'); |
| 112 | 112 | |
| 113 | 113 | if ($use_gravatar) { |
| 114 | - static::updated(function (Employee $employee) { |
|
| 114 | + static::updated(function(Employee $employee) { |
|
| 115 | 115 | $changed_attributes = $employee->getDirty(); |
| 116 | 116 | |
| 117 | 117 | if (array_key_exists('work_email', $changed_attributes)) { |