@@ -22,41 +22,41 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @return void |
| 24 | 24 | */ |
| 25 | - public function setup() : void |
|
| 25 | + public function setup () : void |
|
| 26 | 26 | { |
| 27 | 27 | // Eloquent model to associate with this collection |
| 28 | 28 | // of views and controller actions. |
| 29 | - $this->crud->setModel('App\Models\Skill'); |
|
| 29 | + $this->crud->setModel ('App\Models\Skill'); |
|
| 30 | 30 | // Custom backpack route. |
| 31 | - $this->crud->setRoute('admin/skill'); |
|
| 31 | + $this->crud->setRoute ('admin/skill'); |
|
| 32 | 32 | // Custom strings to display within the backpack UI, |
| 33 | 33 | // things like Create Skill, Delete Skills, etc. |
| 34 | - $this->crud->setEntityNameStrings('skill', 'skills'); |
|
| 34 | + $this->crud->setEntityNameStrings ('skill', 'skills'); |
|
| 35 | 35 | |
| 36 | - $this->crud->operation(['create', 'update'], function () { |
|
| 36 | + $this->crud->operation (['create', 'update'], function () { |
|
| 37 | 37 | // Add custom fields to the create/update views. |
| 38 | - $this->crud->addField([ |
|
| 38 | + $this->crud->addField ([ |
|
| 39 | 39 | 'name' => 'name', |
| 40 | 40 | 'type' => 'text', |
| 41 | 41 | 'label' => 'Name', |
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | - $this->crud->addField([ |
|
| 44 | + $this->crud->addField ([ |
|
| 45 | 45 | 'name' => 'description', |
| 46 | 46 | 'type' => 'textarea', |
| 47 | 47 | 'label' => 'Description', |
| 48 | 48 | 'limit' => 70, |
| 49 | 49 | ]); |
| 50 | 50 | |
| 51 | - $this->crud->addField([ |
|
| 51 | + $this->crud->addField ([ |
|
| 52 | 52 | 'name' => 'skill_type_id', |
| 53 | 53 | 'label' => 'Type', |
| 54 | 54 | 'type' => 'select_from_array', |
| 55 | - 'options' => SkillType::all()->pluck('name', 'id')->toArray(), |
|
| 55 | + 'options' => SkillType::all ()->pluck ('name', 'id')->toArray (), |
|
| 56 | 56 | 'allow_null' => false, |
| 57 | 57 | ]); |
| 58 | 58 | |
| 59 | - $this->crud->addField([ |
|
| 59 | + $this->crud->addField ([ |
|
| 60 | 60 | 'name' => 'classifications', |
| 61 | 61 | 'type' => 'select2_multiple', |
| 62 | 62 | 'label' => 'Classifications (select all that apply)', |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | 'pivot' => true, |
| 67 | 67 | ]); |
| 68 | 68 | |
| 69 | - $this->crud->addField([ |
|
| 69 | + $this->crud->addField ([ |
|
| 70 | 70 | 'name' => 'is_culture_skill', |
| 71 | 71 | 'label' => 'This is a culture skill', |
| 72 | 72 | 'type' => 'checkbox' |
| 73 | 73 | ]); |
| 74 | 74 | |
| 75 | - $this->crud->addField([ |
|
| 75 | + $this->crud->addField ([ |
|
| 76 | 76 | 'name' => 'is_future_skill', |
| 77 | 77 | 'label' => 'This is a future skill', |
| 78 | 78 | 'type' => 'checkbox' |
@@ -80,61 +80,61 @@ discard block |
||
| 80 | 80 | }); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function setupListOperation() |
|
| 83 | + public function setupListOperation () |
|
| 84 | 84 | { |
| 85 | 85 | // Workaround for how the unique_translation validation |
| 86 | 86 | // works in App\Http\Requests\SkillCrudRequest. |
| 87 | 87 | $locale = 'en'; |
| 88 | - if (null !== $this->request->input('locale')) { |
|
| 89 | - $locale = $this->request->input('locale'); |
|
| 88 | + if (null !== $this->request->input ('locale')) { |
|
| 89 | + $locale = $this->request->input ('locale'); |
|
| 90 | 90 | } |
| 91 | - App::setLocale($locale); |
|
| 91 | + App::setLocale ($locale); |
|
| 92 | 92 | |
| 93 | 93 | // Remove delete button. |
| 94 | - $this->crud->removeButton('delete'); |
|
| 94 | + $this->crud->removeButton ('delete'); |
|
| 95 | 95 | |
| 96 | 96 | // Add custom columns to the Skill index view. |
| 97 | - $this->crud->addColumn([ |
|
| 97 | + $this->crud->addColumn ([ |
|
| 98 | 98 | 'name' => 'id', |
| 99 | 99 | 'type' => 'text', |
| 100 | 100 | 'label' => 'ID', |
| 101 | 101 | 'orderable' => true |
| 102 | 102 | ]); |
| 103 | 103 | |
| 104 | - $this->crud->addColumn([ |
|
| 104 | + $this->crud->addColumn ([ |
|
| 105 | 105 | 'name' => 'name', |
| 106 | 106 | 'type' => 'text', |
| 107 | 107 | 'label' => 'Name', |
| 108 | 108 | 'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void { |
| 109 | - $query->orWhere('name->' . $locale, 'like', "%$searchTerm%"); |
|
| 109 | + $query->orWhere ('name->'.$locale, 'like', "%$searchTerm%"); |
|
| 110 | 110 | }, |
| 111 | 111 | 'orderLogic' => function ($query, $column, $columnDirection) use ($locale) { |
| 112 | - return $query->orderBy('name->' . $locale, $columnDirection)->select('*'); |
|
| 112 | + return $query->orderBy ('name->'.$locale, $columnDirection)->select ('*'); |
|
| 113 | 113 | } |
| 114 | 114 | ]); |
| 115 | 115 | |
| 116 | - $this->crud->addColumn([ |
|
| 116 | + $this->crud->addColumn ([ |
|
| 117 | 117 | 'name' => 'description', |
| 118 | 118 | 'type' => 'text', |
| 119 | 119 | 'label' => 'Description', |
| 120 | 120 | 'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void { |
| 121 | - $query->orWhere('description->' . $locale, 'like', "%$searchTerm%"); |
|
| 121 | + $query->orWhere ('description->'.$locale, 'like', "%$searchTerm%"); |
|
| 122 | 122 | }, |
| 123 | 123 | 'orderable' => false, |
| 124 | 124 | ]); |
| 125 | 125 | |
| 126 | - $this->crud->addColumn([ |
|
| 126 | + $this->crud->addColumn ([ |
|
| 127 | 127 | 'name' => 'skill_type.name', |
| 128 | 128 | 'key' => 'skill_type_name', |
| 129 | 129 | 'type' => 'text', |
| 130 | 130 | 'label' => 'Type', |
| 131 | 131 | 'orderable' => true, |
| 132 | 132 | 'orderLogic' => function ($query, $column, $columnDirection) use ($locale) { |
| 133 | - return $query->orderBy('skill_type_id', $columnDirection)->select('*'); |
|
| 133 | + return $query->orderBy ('skill_type_id', $columnDirection)->select ('*'); |
|
| 134 | 134 | } |
| 135 | 135 | ]); |
| 136 | 136 | |
| 137 | - $this->crud->addColumn([ |
|
| 137 | + $this->crud->addColumn ([ |
|
| 138 | 138 | 'label' => 'Classifications', |
| 139 | 139 | 'type' => 'select_multiple', |
| 140 | 140 | 'name' => 'classifications', |
@@ -143,14 +143,14 @@ discard block |
||
| 143 | 143 | 'model' => 'App\Models\Skill', |
| 144 | 144 | ]); |
| 145 | 145 | |
| 146 | - $this->crud->addColumn([ |
|
| 146 | + $this->crud->addColumn ([ |
|
| 147 | 147 | 'name' => 'is_culture_skill', |
| 148 | 148 | 'label' => 'Culture', |
| 149 | 149 | 'type' => 'boolean', |
| 150 | 150 | 'orderable' => true, |
| 151 | 151 | ]); |
| 152 | 152 | |
| 153 | - $this->crud->addColumn([ |
|
| 153 | + $this->crud->addColumn ([ |
|
| 154 | 154 | 'name' => 'is_future_skill', |
| 155 | 155 | 'label' => 'Future', |
| 156 | 156 | 'type' => 'boolean', |
@@ -158,25 +158,25 @@ discard block |
||
| 158 | 158 | ]); |
| 159 | 159 | |
| 160 | 160 | // Add select2_multiple filter for classifications. |
| 161 | - $this->crud->addFilter([ |
|
| 161 | + $this->crud->addFilter ([ |
|
| 162 | 162 | 'name' => 'classifications', |
| 163 | 163 | 'key' => 'classifications_filter', |
| 164 | 164 | 'type' => 'select2_multiple', |
| 165 | 165 | 'label' => 'Filter by classification' |
| 166 | 166 | ], function () { |
| 167 | 167 | // The options that show up in the select2. |
| 168 | - return Classification::all()->pluck('key', 'id')->toArray(); |
|
| 168 | + return Classification::all ()->pluck ('key', 'id')->toArray (); |
|
| 169 | 169 | }, function ($values) { |
| 170 | 170 | // If the filter is active. |
| 171 | - foreach (json_decode($values) as $key => $value) { |
|
| 172 | - $this->crud->query = $this->crud->query->whereHas('classifications', function ($query) use ($value) { |
|
| 173 | - $query->where('id', $value); |
|
| 171 | + foreach (json_decode ($values) as $key => $value) { |
|
| 172 | + $this->crud->query = $this->crud->query->whereHas ('classifications', function ($query) use ($value) { |
|
| 173 | + $query->where ('id', $value); |
|
| 174 | 174 | }); |
| 175 | 175 | } |
| 176 | 176 | }); |
| 177 | 177 | |
| 178 | 178 | // Add filter for skills without classifications. |
| 179 | - $this->crud->addFilter( |
|
| 179 | + $this->crud->addFilter ( |
|
| 180 | 180 | [ |
| 181 | 181 | 'type' => 'simple', |
| 182 | 182 | 'name' => 'noClassification', |
@@ -184,18 +184,18 @@ discard block |
||
| 184 | 184 | ], |
| 185 | 185 | false, |
| 186 | 186 | function () { |
| 187 | - $this->crud->query = $this->crud->query->doesntHave('classifications'); |
|
| 187 | + $this->crud->query = $this->crud->query->doesntHave ('classifications'); |
|
| 188 | 188 | } |
| 189 | 189 | ); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - public function setupCreateOperation() |
|
| 192 | + public function setupCreateOperation () |
|
| 193 | 193 | { |
| 194 | - $this->crud->setValidation(StoreRequest::class); |
|
| 194 | + $this->crud->setValidation (StoreRequest::class); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - public function setupUpdateOperation() |
|
| 197 | + public function setupUpdateOperation () |
|
| 198 | 198 | { |
| 199 | - $this->crud->setValidation(UpdateRequest::class); |
|
| 199 | + $this->crud->setValidation (UpdateRequest::class); |
|
| 200 | 200 | } |
| 201 | 201 | } |
@@ -15,51 +15,51 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | * @return void |
| 17 | 17 | */ |
| 18 | - public function setup() : void |
|
| 18 | + public function setup () : void |
|
| 19 | 19 | { |
| 20 | - $this->crud->setModel('App\Models\User'); |
|
| 21 | - $this->crud->setRoute('admin/manager'); |
|
| 22 | - $this->crud->setEntityNameStrings('manager', 'managers'); |
|
| 20 | + $this->crud->setModel ('App\Models\User'); |
|
| 21 | + $this->crud->setRoute ('admin/manager'); |
|
| 22 | + $this->crud->setEntityNameStrings ('manager', 'managers'); |
|
| 23 | 23 | |
| 24 | 24 | // Don't show 'basic' users. |
| 25 | - $this->crud->addClause('whereIn', 'user_role_id', [2, 3]); |
|
| 25 | + $this->crud->addClause ('whereIn', 'user_role_id', [2, 3]); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function setupListOperation() |
|
| 28 | + public function setupListOperation () |
|
| 29 | 29 | { |
| 30 | - $this->crud->removeButton('update'); |
|
| 30 | + $this->crud->removeButton ('update'); |
|
| 31 | 31 | |
| 32 | - $this->crud->addColumn([ |
|
| 32 | + $this->crud->addColumn ([ |
|
| 33 | 33 | 'name' => 'manager.id', |
| 34 | 34 | 'key' => 'manager_id', |
| 35 | 35 | 'type' => 'number', |
| 36 | 36 | 'label' => 'ID' |
| 37 | 37 | ]); |
| 38 | - $this->crud->addColumn([ |
|
| 38 | + $this->crud->addColumn ([ |
|
| 39 | 39 | 'name' => 'manager.name', |
| 40 | 40 | 'key' => 'manager_name', |
| 41 | 41 | 'type' => 'text', |
| 42 | 42 | 'label' => 'Name' |
| 43 | 43 | ]); |
| 44 | - $this->crud->addColumn([ |
|
| 44 | + $this->crud->addColumn ([ |
|
| 45 | 45 | 'name' => 'user_role.name', |
| 46 | 46 | 'type' => 'text', |
| 47 | 47 | 'key' => 'user_role_name', |
| 48 | 48 | 'label' => 'Role' |
| 49 | 49 | ]); |
| 50 | - $this->crud->addColumn([ |
|
| 50 | + $this->crud->addColumn ([ |
|
| 51 | 51 | 'name' => 'email', |
| 52 | 52 | 'key' => 'manager_email', |
| 53 | 53 | 'type' => 'text', |
| 54 | 54 | 'label' => 'Email' |
| 55 | 55 | ]); |
| 56 | - $this->crud->addColumn([ |
|
| 56 | + $this->crud->addColumn ([ |
|
| 57 | 57 | 'name' => 'gov_email', |
| 58 | 58 | 'key' => 'government_email', |
| 59 | 59 | 'type' => 'text', |
| 60 | 60 | 'label' => 'Government Email' |
| 61 | 61 | ]); |
| 62 | - $this->crud->addColumn([ |
|
| 62 | + $this->crud->addColumn ([ |
|
| 63 | 63 | 'name' => 'manager.department.name', |
| 64 | 64 | 'key' => 'manager_department', |
| 65 | 65 | 'type' => 'text', |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ]); |
| 69 | 69 | |
| 70 | 70 | // Add the custom blade button found in resources/views/vendor/backpack/crud/buttons/profile_edit.blade.php. |
| 71 | - $this->crud->addButtonFromView('line', 'create_job_poster', 'create_job_poster', 'beginning'); |
|
| 72 | - $this->crud->addButtonFromView('line', 'profile_edit', 'profile_edit', 'end'); |
|
| 71 | + $this->crud->addButtonFromView ('line', 'create_job_poster', 'create_job_poster', 'beginning'); |
|
| 72 | + $this->crud->addButtonFromView ('line', 'profile_edit', 'profile_edit', 'end'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
@@ -20,29 +20,29 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | - public function setup() : void |
|
| 23 | + public function setup () : void |
|
| 24 | 24 | { |
| 25 | 25 | // Eloquent model to associate with this collection of views and controller actions. |
| 26 | - $this->crud->setModel('App\Models\Lookup\Department'); |
|
| 26 | + $this->crud->setModel ('App\Models\Lookup\Department'); |
|
| 27 | 27 | // Custom backpack route. |
| 28 | - $this->crud->setRoute('admin/department'); |
|
| 28 | + $this->crud->setRoute ('admin/department'); |
|
| 29 | 29 | // Custom strings to display within the backpack UI. |
| 30 | - $this->crud->setEntityNameStrings('department', 'departments'); |
|
| 30 | + $this->crud->setEntityNameStrings ('department', 'departments'); |
|
| 31 | 31 | |
| 32 | - $this->crud->operation(['create', 'update'], function () { |
|
| 33 | - $this->crud->addField([ |
|
| 32 | + $this->crud->operation (['create', 'update'], function () { |
|
| 33 | + $this->crud->addField ([ |
|
| 34 | 34 | 'name' => 'name', |
| 35 | 35 | 'type' => 'text', |
| 36 | 36 | 'label' => 'Name', |
| 37 | 37 | ]); |
| 38 | 38 | |
| 39 | - $this->crud->addField([ |
|
| 39 | + $this->crud->addField ([ |
|
| 40 | 40 | 'name' => 'impact', |
| 41 | 41 | 'type' => 'textarea', |
| 42 | 42 | 'label' => 'Impact', |
| 43 | 43 | ]); |
| 44 | 44 | |
| 45 | - $this->crud->addField([ |
|
| 45 | + $this->crud->addField ([ |
|
| 46 | 46 | 'name' => 'preference', |
| 47 | 47 | 'type' => 'textarea', |
| 48 | 48 | 'label' => 'Preference', |
@@ -50,38 +50,38 @@ discard block |
||
| 50 | 50 | }); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function setupListOperation() |
|
| 53 | + public function setupListOperation () |
|
| 54 | 54 | { |
| 55 | 55 | // Required for order logic. |
| 56 | 56 | $locale = 'en'; |
| 57 | - if (null !== $this->request->input('locale')) { |
|
| 58 | - $locale = $this->request->input('locale'); |
|
| 57 | + if (null !== $this->request->input ('locale')) { |
|
| 58 | + $locale = $this->request->input ('locale'); |
|
| 59 | 59 | } |
| 60 | - App::setLocale($locale); |
|
| 60 | + App::setLocale ($locale); |
|
| 61 | 61 | |
| 62 | 62 | // Remove delete button. |
| 63 | - $this->crud->removeButton('delete'); |
|
| 63 | + $this->crud->removeButton ('delete'); |
|
| 64 | 64 | |
| 65 | 65 | // Add custom columns to the Department index view. |
| 66 | - $this->crud->addColumn([ |
|
| 66 | + $this->crud->addColumn ([ |
|
| 67 | 67 | 'name' => 'id', |
| 68 | 68 | 'type' => 'text', |
| 69 | 69 | 'label' => 'ID', |
| 70 | 70 | 'orderable' => true, |
| 71 | 71 | ]); |
| 72 | 72 | |
| 73 | - $this->crud->addColumn([ |
|
| 73 | + $this->crud->addColumn ([ |
|
| 74 | 74 | 'name' => 'name', |
| 75 | 75 | 'type' => 'text', |
| 76 | 76 | 'label' => 'Name', |
| 77 | 77 | 'orderable' => true, |
| 78 | 78 | 'limit' => 70, |
| 79 | 79 | 'orderLogic' => function ($query, $column, $columnDirection) use ($locale) { |
| 80 | - return $query->orderBy('name->' . $locale, $columnDirection)->select('*'); |
|
| 80 | + return $query->orderBy ('name->'.$locale, $columnDirection)->select ('*'); |
|
| 81 | 81 | } |
| 82 | 82 | ]); |
| 83 | 83 | |
| 84 | - $this->crud->addColumn([ |
|
| 84 | + $this->crud->addColumn ([ |
|
| 85 | 85 | 'name' => 'impact', |
| 86 | 86 | 'type' => 'text', |
| 87 | 87 | 'label' => 'Impact', |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | 'limit' => 70, |
| 90 | 90 | ]); |
| 91 | 91 | |
| 92 | - $this->crud->addColumn([ |
|
| 92 | + $this->crud->addColumn ([ |
|
| 93 | 93 | 'name' => 'preference', |
| 94 | 94 | 'type' => 'text', |
| 95 | 95 | 'label' => 'Preference', |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | ]); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - public function setupCreateOperation() |
|
| 101 | + public function setupCreateOperation () |
|
| 102 | 102 | { |
| 103 | - $this->crud->setValidation(StoreRequest::class); |
|
| 103 | + $this->crud->setValidation (StoreRequest::class); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - public function setupUpdateOperation() |
|
| 106 | + public function setupUpdateOperation () |
|
| 107 | 107 | { |
| 108 | - $this->crud->setValidation(UpdateRequest::class); |
|
| 108 | + $this->crud->setValidation (UpdateRequest::class); |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @return void |
| 20 | 20 | */ |
| 21 | - public function setup() : void |
|
| 21 | + public function setup () : void |
|
| 22 | 22 | { |
| 23 | 23 | // Eloquent model to associate with this collection of views and controller actions. |
| 24 | - $this->crud->setModel('App\Models\Classification'); |
|
| 24 | + $this->crud->setModel ('App\Models\Classification'); |
|
| 25 | 25 | // Custom backpack route. |
| 26 | - $this->crud->setRoute('admin/classification'); |
|
| 26 | + $this->crud->setRoute ('admin/classification'); |
|
| 27 | 27 | // Custom strings to display within the backpack UI. |
| 28 | - $this->crud->setEntityNameStrings('classification', 'classifications'); |
|
| 28 | + $this->crud->setEntityNameStrings ('classification', 'classifications'); |
|
| 29 | 29 | |
| 30 | - $this->crud->operation(['create', 'update'], function () { |
|
| 31 | - $this->crud->addField([ |
|
| 30 | + $this->crud->operation (['create', 'update'], function () { |
|
| 31 | + $this->crud->addField ([ |
|
| 32 | 32 | 'name' => 'key', |
| 33 | 33 | 'type' => 'text', |
| 34 | 34 | 'label' => 'Key', |
@@ -36,28 +36,28 @@ discard block |
||
| 36 | 36 | }); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - public function setupListOperation() |
|
| 39 | + public function setupListOperation () |
|
| 40 | 40 | { |
| 41 | - $this->crud->addColumn([ |
|
| 41 | + $this->crud->addColumn ([ |
|
| 42 | 42 | 'name' => 'id', |
| 43 | 43 | 'type' => 'text', |
| 44 | 44 | 'label' => 'ID', |
| 45 | 45 | ]); |
| 46 | 46 | |
| 47 | - $this->crud->addColumn([ |
|
| 47 | + $this->crud->addColumn ([ |
|
| 48 | 48 | 'name' => 'key', |
| 49 | 49 | 'type' => 'text', |
| 50 | 50 | 'label' => 'Key', |
| 51 | 51 | ]); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function setupCreateOperation() |
|
| 54 | + public function setupCreateOperation () |
|
| 55 | 55 | { |
| 56 | - $this->crud->setValidation(StoreRequest::class); |
|
| 56 | + $this->crud->setValidation (StoreRequest::class); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public function setupUpdateOperation() |
|
| 59 | + public function setupUpdateOperation () |
|
| 60 | 60 | { |
| 61 | - $this->crud->setValidation(UpdateRequest::class); |
|
| 61 | + $this->crud->setValidation (UpdateRequest::class); |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -13,29 +13,29 @@ discard block |
||
| 13 | 13 | * Show the applicant home page. |
| 14 | 14 | * @return \Illuminate\Http\Response |
| 15 | 15 | */ |
| 16 | - public function applicant() |
|
| 16 | + public function applicant () |
|
| 17 | 17 | { |
| 18 | - $now = Carbon::now(); |
|
| 18 | + $now = Carbon::now (); |
|
| 19 | 19 | |
| 20 | 20 | // Find three most recent published jobs that are currently open for applications. |
| 21 | 21 | // Eager load required relationships: Department, Province, JobTerm. |
| 22 | - $jobs = JobPoster::where('open_date_time', '<=', $now) |
|
| 23 | - ->where('close_date_time', '>=', $now) |
|
| 24 | - ->where('published', true) |
|
| 25 | - ->with([ |
|
| 22 | + $jobs = JobPoster::where ('open_date_time', '<=', $now) |
|
| 23 | + ->where ('close_date_time', '>=', $now) |
|
| 24 | + ->where ('published', true) |
|
| 25 | + ->with ([ |
|
| 26 | 26 | 'department', |
| 27 | 27 | 'province', |
| 28 | 28 | ]) |
| 29 | - ->orderBy('open_date_time', 'desc') |
|
| 30 | - ->take(3) |
|
| 31 | - ->get(); |
|
| 32 | - return view('applicant/home', [ |
|
| 33 | - 'home' => Lang::get('applicant/home'), |
|
| 34 | - 'hero' => Lang::get('common/hero'), |
|
| 35 | - 'job_index' => Lang::get('applicant/job_index'), |
|
| 36 | - 'job_post' => Lang::get('applicant/job_post'), |
|
| 29 | + ->orderBy ('open_date_time', 'desc') |
|
| 30 | + ->take (3) |
|
| 31 | + ->get (); |
|
| 32 | + return view ('applicant/home', [ |
|
| 33 | + 'home' => Lang::get ('applicant/home'), |
|
| 34 | + 'hero' => Lang::get ('common/hero'), |
|
| 35 | + 'job_index' => Lang::get ('applicant/job_index'), |
|
| 36 | + 'job_post' => Lang::get ('applicant/job_post'), |
|
| 37 | 37 | 'jobs' => $jobs, |
| 38 | - 'job_count' => count($jobs) |
|
| 38 | + 'job_count' => count ($jobs) |
|
| 39 | 39 | ]); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | * Show the manager home page. |
| 44 | 44 | * @return \Illuminate\Http\Response |
| 45 | 45 | */ |
| 46 | - public function manager() |
|
| 46 | + public function manager () |
|
| 47 | 47 | { |
| 48 | - return view('manager/home', [ |
|
| 49 | - 'home_l10n' => Lang::get('manager/home'), |
|
| 48 | + return view ('manager/home', [ |
|
| 49 | + 'home_l10n' => Lang::get ('manager/home'), |
|
| 50 | 50 | ]); |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | - public function __construct() |
|
| 29 | + public function __construct () |
|
| 30 | 30 | { |
| 31 | - $this->middleware('guest'); |
|
| 31 | + $this->middleware ('guest'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @return \Illuminate\Http\Response |
| 40 | 40 | */ |
| 41 | - public function showLinkRequestForm() |
|
| 41 | + public function showLinkRequestForm () |
|
| 42 | 42 | { |
| 43 | - return view('auth.passwords.email', [ |
|
| 44 | - 'routes' => $this->auth_routes(), |
|
| 45 | - 'forgot_password' => Lang::get('common/auth/forgot_password'), |
|
| 43 | + return view ('auth.passwords.email', [ |
|
| 44 | + 'routes' => $this->auth_routes (), |
|
| 45 | + 'forgot_password' => Lang::get ('common/auth/forgot_password'), |
|
| 46 | 46 | ]); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -12,27 +12,27 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @return mixed[] |
| 14 | 14 | */ |
| 15 | - protected function auth_routes() |
|
| 15 | + protected function auth_routes () |
|
| 16 | 16 | { |
| 17 | - if (WhichPortal::isManagerPortal()) { |
|
| 17 | + if (WhichPortal::isManagerPortal ()) { |
|
| 18 | 18 | $routes = [ |
| 19 | - 'home' => route('manager.home'), |
|
| 20 | - 'login' => route('manager.login'), |
|
| 21 | - 'register' => route('manager.register'), |
|
| 19 | + 'home' => route ('manager.home'), |
|
| 20 | + 'login' => route ('manager.login'), |
|
| 21 | + 'register' => route ('manager.register'), |
|
| 22 | 22 | 'password' => [ |
| 23 | - 'email' => route('manager.password.email'), |
|
| 24 | - 'request' => route('manager.password.request'), |
|
| 23 | + 'email' => route ('manager.password.email'), |
|
| 24 | + 'request' => route ('manager.password.request'), |
|
| 25 | 25 | ], |
| 26 | 26 | // 'passwords.reset' => route('manager.password.reset'), |
| 27 | 27 | ]; |
| 28 | 28 | } else { |
| 29 | 29 | $routes = [ |
| 30 | - 'home' => route('home'), |
|
| 31 | - 'login' => route('login'), |
|
| 32 | - 'register' => route('register'), |
|
| 30 | + 'home' => route ('home'), |
|
| 31 | + 'login' => route ('login'), |
|
| 32 | + 'register' => route ('register'), |
|
| 33 | 33 | 'password' => [ |
| 34 | - 'email' => route('password.email'), |
|
| 35 | - 'request' => route('password.request'), |
|
| 34 | + 'email' => route ('password.email'), |
|
| 35 | + 'request' => route ('password.request'), |
|
| 36 | 36 | ], |
| 37 | 37 | // 'passwords.reset' => route('password.reset'), |
| 38 | 38 | ]; |
@@ -17,18 +17,18 @@ discard block |
||
| 17 | 17 | * @param Request $request |
| 18 | 18 | * @return \Illuminate\Http\Response |
| 19 | 19 | */ |
| 20 | - public function showFirstVisitManagerForm() |
|
| 20 | + public function showFirstVisitManagerForm () |
|
| 21 | 21 | { |
| 22 | 22 | $routes = [ |
| 23 | - 'return' => route('home'), |
|
| 24 | - 'continue' => route('manager.finish_registration'), |
|
| 23 | + 'return' => route ('home'), |
|
| 24 | + 'continue' => route ('manager.finish_registration'), |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | - return view('auth.first_visit_manager', [ |
|
| 27 | + return view ('auth.first_visit_manager', [ |
|
| 28 | 28 | 'routes' => $routes, |
| 29 | - 'first_visit' => Lang::get('common/auth/first_manager_visit'), |
|
| 30 | - 'departments' => Department::all(), |
|
| 31 | - 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')], |
|
| 29 | + 'first_visit' => Lang::get ('common/auth/first_manager_visit'), |
|
| 30 | + 'departments' => Department::all (), |
|
| 31 | + 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')], |
|
| 32 | 32 | ]); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -38,36 +38,36 @@ discard block |
||
| 38 | 38 | * @param Request $request |
| 39 | 39 | * @return void |
| 40 | 40 | */ |
| 41 | - public function finishManagerRegistration(Request $request) |
|
| 41 | + public function finishManagerRegistration (Request $request) |
|
| 42 | 42 | { |
| 43 | - $data = $request->all(); |
|
| 44 | - $validator = RegistrationValidator::finalizeManagerValidator($data); |
|
| 45 | - $validator->validate(); |
|
| 43 | + $data = $request->all (); |
|
| 44 | + $validator = RegistrationValidator::finalizeManagerValidator ($data); |
|
| 45 | + $validator->validate (); |
|
| 46 | 46 | |
| 47 | - $user = $request->user(); |
|
| 47 | + $user = $request->user (); |
|
| 48 | 48 | |
| 49 | 49 | // Save manager specific fields to user |
| 50 | - $managerDepartment = Department::find($data['department']); |
|
| 50 | + $managerDepartment = Department::find ($data['department']); |
|
| 51 | 51 | $inGovernment = ($managerDepartment !== null); |
| 52 | 52 | $user->not_in_gov = !$inGovernment; |
| 53 | 53 | $user->gov_email = $inGovernment ? $data['gov_email'] : null; |
| 54 | - $user->save(); |
|
| 55 | - $user->refresh(); |
|
| 54 | + $user->save (); |
|
| 55 | + $user->refresh (); |
|
| 56 | 56 | |
| 57 | 57 | // Add (or update) manager profile |
| 58 | 58 | // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan |
| 59 | 59 | // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception. |
| 60 | 60 | $department_id = $inGovernment ? $managerDepartment->id : null; |
| 61 | 61 | if ($user->manager === null) { |
| 62 | - $user->applicant()->save(new Manager()); |
|
| 63 | - $user->refresh(); |
|
| 62 | + $user->applicant ()->save (new Manager ()); |
|
| 63 | + $user->refresh (); |
|
| 64 | 64 | } |
| 65 | 65 | $user->manager->department_id = $department_id; |
| 66 | - $user->manager->save(); |
|
| 66 | + $user->manager->save (); |
|
| 67 | 67 | |
| 68 | - $user->refresh(); |
|
| 69 | - $expectedUrl = session()->remove('url.expected'); |
|
| 70 | - session()->remove('url.expected'); |
|
| 71 | - return redirect($expectedUrl); |
|
| 68 | + $user->refresh (); |
|
| 69 | + $expectedUrl = session ()->remove ('url.expected'); |
|
| 70 | + session ()->remove ('url.expected'); |
|
| 71 | + return redirect ($expectedUrl); |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return string |
| 37 | 37 | */ |
| 38 | - protected function redirectTo() |
|
| 38 | + protected function redirectTo () |
|
| 39 | 39 | { |
| 40 | - $redirectTo = WhichPortal::isManagerPortal() ? route('manager.home') : route('home'); |
|
| 40 | + $redirectTo = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home'); |
|
| 41 | 41 | return $redirectTo; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return void |
| 48 | 48 | */ |
| 49 | - public function __construct() |
|
| 49 | + public function __construct () |
|
| 50 | 50 | { |
| 51 | - $this->middleware('guest'); |
|
| 51 | + $this->middleware ('guest'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @return \Illuminate\Http\Response |
| 58 | 58 | */ |
| 59 | - public function showRegistrationForm() |
|
| 59 | + public function showRegistrationForm () |
|
| 60 | 60 | { |
| 61 | - return view('auth.register', [ |
|
| 62 | - 'routes' => $this->auth_routes(), |
|
| 63 | - 'register' => Lang::get('common/auth/register'), |
|
| 64 | - 'home_url' => route('home'), |
|
| 61 | + return view ('auth.register', [ |
|
| 62 | + 'routes' => $this->auth_routes (), |
|
| 63 | + 'register' => Lang::get ('common/auth/register'), |
|
| 64 | + 'home_url' => route ('home'), |
|
| 65 | 65 | ]); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return \Illuminate\Http\Response |
| 72 | 72 | */ |
| 73 | - public function showManagerRegistrationForm() |
|
| 73 | + public function showManagerRegistrationForm () |
|
| 74 | 74 | { |
| 75 | - return view('auth.register_manager', [ |
|
| 76 | - 'routes' => $this->auth_routes(), |
|
| 77 | - 'register' => Lang::get('common/auth/register'), |
|
| 78 | - 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')], |
|
| 79 | - 'departments' => Department::all(), |
|
| 80 | - 'home_url' => route('manager.home'), |
|
| 75 | + return view ('auth.register_manager', [ |
|
| 76 | + 'routes' => $this->auth_routes (), |
|
| 77 | + 'register' => Lang::get ('common/auth/register'), |
|
| 78 | + 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')], |
|
| 79 | + 'departments' => Department::all (), |
|
| 80 | + 'home_url' => route ('manager.home'), |
|
| 81 | 81 | ]); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | * @param array $data Incoming registration data. |
| 89 | 89 | * @return \Illuminate\Contracts\Validation\Validator |
| 90 | 90 | */ |
| 91 | - protected function validator(array $data) |
|
| 91 | + protected function validator (array $data) |
|
| 92 | 92 | { |
| 93 | - return RegistrationValidator::userValidator($data); |
|
| 93 | + return RegistrationValidator::userValidator ($data); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | * @param array $data Incoming registration data. |
| 100 | 100 | * @return \Illuminate\Contracts\Validation\Validator |
| 101 | 101 | */ |
| 102 | - protected function managerValidator(array $data) |
|
| 102 | + protected function managerValidator (array $data) |
|
| 103 | 103 | { |
| 104 | - return RegistrationValidator::managerValidator($data); |
|
| 104 | + return RegistrationValidator::managerValidator ($data); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -110,22 +110,22 @@ discard block |
||
| 110 | 110 | * @param array $data Incoming User data. |
| 111 | 111 | * @return \App\Models\User |
| 112 | 112 | */ |
| 113 | - protected function create(array $data) |
|
| 113 | + protected function create (array $data) |
|
| 114 | 114 | { |
| 115 | - $user = new User(); |
|
| 115 | + $user = new User (); |
|
| 116 | 116 | $user->first_name = $data['first_name']; |
| 117 | 117 | $user->last_name = $data['last_name']; |
| 118 | 118 | $user->email = $data['email']; |
| 119 | - $user->password = Hash::make($data['password']); |
|
| 119 | + $user->password = Hash::make ($data['password']); |
|
| 120 | 120 | |
| 121 | 121 | // Default to basic user. |
| 122 | - $user->setRole('basic'); |
|
| 122 | + $user->setRole ('basic'); |
|
| 123 | 123 | |
| 124 | - $user->save(); |
|
| 124 | + $user->save (); |
|
| 125 | 125 | |
| 126 | - $user->applicant()->save(new Applicant()); |
|
| 126 | + $user->applicant ()->save (new Applicant ()); |
|
| 127 | 127 | |
| 128 | - return $user->fresh(); |
|
| 128 | + return $user->fresh (); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -134,31 +134,31 @@ discard block |
||
| 134 | 134 | * @param array $data Incoming User data. |
| 135 | 135 | * @return \App\Models\User |
| 136 | 136 | */ |
| 137 | - protected function createManager(array $data) |
|
| 137 | + protected function createManager (array $data) |
|
| 138 | 138 | { |
| 139 | 139 | // Create basic user. |
| 140 | - $user = $this->create($data); |
|
| 140 | + $user = $this->create ($data); |
|
| 141 | 141 | |
| 142 | 142 | // Save manager specific fields. |
| 143 | - $managerDepartment = Department::find($data['department']); |
|
| 143 | + $managerDepartment = Department::find ($data['department']); |
|
| 144 | 144 | $inGovernment = ($managerDepartment !== null); |
| 145 | 145 | $user->not_in_gov = !$inGovernment; |
| 146 | 146 | $user->gov_email = $inGovernment ? $data['gov_email'] : null; |
| 147 | - $user->save(); |
|
| 148 | - $user->refresh(); |
|
| 147 | + $user->save (); |
|
| 148 | + $user->refresh (); |
|
| 149 | 149 | |
| 150 | 150 | // Add (or update) manager profile. |
| 151 | 151 | // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan |
| 152 | 152 | // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception. |
| 153 | 153 | $department_id = $inGovernment ? $managerDepartment->id : null; |
| 154 | 154 | if ($user->manager === null) { |
| 155 | - $user->applicant()->save(new Manager()); |
|
| 156 | - $user->refresh(); |
|
| 155 | + $user->applicant ()->save (new Manager ()); |
|
| 156 | + $user->refresh (); |
|
| 157 | 157 | } |
| 158 | 158 | $user->manager->department_id = $department_id; |
| 159 | - $user->manager->save(); |
|
| 159 | + $user->manager->save (); |
|
| 160 | 160 | |
| 161 | - return $user->fresh(); |
|
| 161 | + return $user->fresh (); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | * @param mixed $user Incoming User data. |
| 170 | 170 | * @return \Illuminate\Http\Response |
| 171 | 171 | */ |
| 172 | - protected function registered(Request $request, $user) |
|
| 172 | + protected function registered (Request $request, $user) |
|
| 173 | 173 | { |
| 174 | - return redirect()->intended($this->redirectTo()); |
|
| 174 | + return redirect ()->intended ($this->redirectTo ()); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -181,15 +181,15 @@ discard block |
||
| 181 | 181 | * @param \Illuminate\Http\Request $request |
| 182 | 182 | * @return \Illuminate\Http\Response |
| 183 | 183 | */ |
| 184 | - public function registerManager(Request $request) |
|
| 184 | + public function registerManager (Request $request) |
|
| 185 | 185 | { |
| 186 | - $this->managerValidator($request->all())->validate(); |
|
| 186 | + $this->managerValidator ($request->all ())->validate (); |
|
| 187 | 187 | |
| 188 | - event(new Registered($user = $this->createManager($request->all()))); |
|
| 188 | + event (new Registered ($user = $this->createManager ($request->all ()))); |
|
| 189 | 189 | |
| 190 | - $this->guard()->login($user); |
|
| 190 | + $this->guard ()->login ($user); |
|
| 191 | 191 | |
| 192 | - return $this->registered($request, $user) |
|
| 193 | - ?: redirect($this->redirectPath()); |
|
| 192 | + return $this->registered ($request, $user) |
|
| 193 | + ?: redirect ($this->redirectPath ()); |
|
| 194 | 194 | } |
| 195 | 195 | } |