Passed
Push — task/add-manager-resource ( c74771 )
by Chris
11:48
created
app/Http/Controllers/Admin/ClassificationCrudController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 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',
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
 
39 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',
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function setupCreateOperation()
55 55
     {
56
-        $this->crud->setValidation(StoreRequest::class);
56
+        $this->crud->setValidation (StoreRequest::class);
57 57
     }
58 58
 
59 59
     public function setupUpdateOperation()
60 60
     {
61
-        $this->crud->setValidation(UpdateRequest::class);
61
+        $this->crud->setValidation (UpdateRequest::class);
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/SkillCrudController.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -26,37 +26,37 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'
@@ -85,56 +85,56 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,44 +158,44 @@  discard block
 block discarded – undo
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
-        ], function () {
166
+        ], function (){
167 167
             // The options that show up in the select2.
168
-            return Classification::all()->pluck('key', 'id')->toArray();
169
-        }, function ($values) {
168
+            return Classification::all ()->pluck ('key', 'id')->toArray ();
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',
183 183
                 'label'=> 'No classification'
184 184
             ],
185 185
             false,
186
-            function () {
187
-                $this->crud->query = $this->crud->query->doesntHave('classifications');
186
+            function (){
187
+                $this->crud->query = $this->crud->query->doesntHave ('classifications');
188 188
             }
189 189
         );
190 190
     }
191 191
 
192 192
     public function setupCreateOperation()
193 193
     {
194
-        $this->crud->setValidation(StoreRequest::class);
194
+        $this->crud->setValidation (StoreRequest::class);
195 195
     }
196 196
 
197 197
     public function setupUpdateOperation()
198 198
     {
199
-        $this->crud->setValidation(UpdateRequest::class);
199
+        $this->crud->setValidation (UpdateRequest::class);
200 200
     }
201 201
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/DepartmentCrudController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 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',
@@ -54,34 +54,34 @@  discard block
 block discarded – undo
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
 block discarded – undo
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',
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 
101 101
     public function setupCreateOperation()
102 102
     {
103
-        $this->crud->setValidation(StoreRequest::class);
103
+        $this->crud->setValidation (StoreRequest::class);
104 104
     }
105 105
 
106 106
     public function setupUpdateOperation()
107 107
     {
108
-        $this->crud->setValidation(UpdateRequest::class);
108
+        $this->crud->setValidation (UpdateRequest::class);
109 109
     }
110 110
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserCrudController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,68 +18,68 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function setup() : void
20 20
     {
21
-        $this->crud->setModel('App\Models\User');
22
-        $this->crud->setRoute('admin/user');
23
-        $this->crud->setEntityNameStrings('user', 'users');
21
+        $this->crud->setModel ('App\Models\User');
22
+        $this->crud->setRoute ('admin/user');
23
+        $this->crud->setEntityNameStrings ('user', 'users');
24 24
     }
25 25
 
26 26
     public function setupListOperation()
27 27
     {
28
-        $this->crud->addColumn([
28
+        $this->crud->addColumn ([
29 29
             'name' => 'id',
30 30
             'type' => 'number',
31 31
             'label' => 'ID'
32 32
         ]);
33
-        $this->crud->addColumn([
33
+        $this->crud->addColumn ([
34 34
             'name' => 'first_name',
35 35
             'type' => 'text',
36 36
             'label' => 'First Name'
37 37
         ]);
38
-        $this->crud->addColumn([
38
+        $this->crud->addColumn ([
39 39
             'name' => 'last_name',
40 40
             'type' => 'text',
41 41
             'label' => 'Last Name'
42 42
         ]);
43
-        $this->crud->addColumn([
43
+        $this->crud->addColumn ([
44 44
             'name' => 'user_role.name',
45 45
             'type' => 'text',
46 46
             'key' => 'user_role_name',
47 47
             'label' => 'Role'
48 48
         ]);
49
-        $this->crud->addColumn([
49
+        $this->crud->addColumn ([
50 50
             'name' => 'email',
51 51
             'type' => 'text',
52 52
             'label' => 'Email'
53 53
         ]);
54
-        $this->crud->addColumn([
54
+        $this->crud->addColumn ([
55 55
             'name' => 'gov_email',
56 56
             'type' => 'text',
57 57
             'label' => 'Government Email'
58 58
         ]);
59
-        $this->crud->addColumn([
59
+        $this->crud->addColumn ([
60 60
             'name' => 'not_in_gov',
61 61
             'type' => 'check',
62 62
             'label' => 'In Government'
63 63
         ]);
64
-        $this->crud->addColumn([
64
+        $this->crud->addColumn ([
65 65
             'name' => 'is_priority',
66 66
             'type' => 'check',
67 67
             'label' => 'Priority'
68 68
         ]);
69
-        $this->crud->addFilter([
69
+        $this->crud->addFilter ([
70 70
             'name' => 'user_role',
71 71
             'type' => 'select2',
72 72
             'label' => 'Role'
73
-            ], function () {
74
-                return UserRole::all()->keyBy('id')->pluck('name', 'id')->toArray();
73
+            ], function (){
74
+                return UserRole::all ()->keyBy ('id')->pluck ('name', 'id')->toArray ();
75 75
             }, function ($value) : void {
76
-                $this->crud->addClause('where', 'user_role_id', $value);
76
+                $this->crud->addClause ('where', 'user_role_id', $value);
77 77
             });
78 78
     }
79 79
 
80 80
     public function setupUpdateOperation()
81 81
     {
82
-        $this->crud->addField([
82
+        $this->crud->addField ([
83 83
             'name' => 'name',
84 84
             'label' => 'Name',
85 85
             'type' => 'text',
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 'readonly'=>'readonly'
88 88
             ]
89 89
         ]);
90
-        $this->crud->addField([
90
+        $this->crud->addField ([
91 91
             'label' => 'Role',
92 92
             'type' => 'select',
93 93
             'name' => 'user_role_id', // The db column for the foreign key.
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             'attribute' => 'name', // Foreign key attribute that is shown to user.
96 96
             'model' => 'App\Models\UserRole' // Foreign key model.
97 97
         ]);
98
-        $this->crud->addField([
98
+        $this->crud->addField ([
99 99
             'name' => 'is_priority',
100 100
             'type' => 'checkbox',
101 101
             'label' => 'Priority'
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ManagerController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function __construct()
18 18
     {
19 19
         // This applies the appropriate policy to each resource route.
20
-        $this->authorizeResource(Manager::class, 'manager');
20
+        $this->authorizeResource (Manager::class, 'manager');
21 21
     }
22 22
 
23 23
     /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function show(Manager $manager)
51 51
     {
52
-        return new ManagerResource($manager);
52
+        return new ManagerResource ($manager);
53 53
     }
54 54
 
55 55
     /**
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function showAuthenticated()
61 61
     {
62
-        $user = Auth::user();
62
+        $user = Auth::user ();
63 63
         if ($user !== null && $user->manager !== null) {
64
-            return new ManagerResource($user->manager);
64
+            return new ManagerResource ($user->manager);
65 65
         }
66
-        return response()->json([]);
66
+        return response ()->json ([]);
67 67
     }
68 68
 
69 69
     /**
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function update(UpdateManagerApi $request, Manager $manager)
77 77
     {
78
-        $validated = $request->validated();
79
-        $manager->fill($validated);
80
-        $manager->save();
81
-        return new ManagerResource($manager);
78
+        $validated = $request->validated ();
79
+        $manager->fill ($validated);
80
+        $manager->save ();
81
+        return new ManagerResource ($manager);
82 82
     }
83 83
 
84 84
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/ApplicationByJobController.php 1 patch
Spacing   +201 added lines, -201 removed lines patch added patch discarded remove patch
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function index(JobPoster $jobPoster)
36 36
     {
37
-        $applications = $jobPoster->submitted_applications()
38
-            ->with([
37
+        $applications = $jobPoster->submitted_applications ()
38
+            ->with ([
39 39
                 'veteran_status',
40 40
                 'citizenship_declaration',
41 41
                 'application_review',
42 42
                 'applicant.user',
43 43
                 'job_poster.criteria',
44 44
             ])
45
-            ->get();
46
-        return view('manager/review_applications', [
45
+            ->get ();
46
+        return view ('manager/review_applications', [
47 47
             // Localization Strings.
48
-            'jobs_l10n' => Lang::get('manager/job_index'),
48
+            'jobs_l10n' => Lang::get ('manager/job_index'),
49 49
             // Data.
50
-            'job' => $jobPoster->toApiArray(),
50
+            'job' => $jobPoster->toApiArray (),
51 51
             'applications' => $applications,
52
-            'review_statuses' => ReviewStatus::all()
52
+            'review_statuses' => ReviewStatus::all ()
53 53
         ]);
54 54
     }
55 55
 
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function getApplicationFromJob(JobPoster $jobPoster)
63 63
     {
64
-        $application = JobApplication::where('applicant_id', Auth::user()->applicant->id)
65
-            ->where('job_poster_id', $jobPoster->id)->first();
64
+        $application = JobApplication::where ('applicant_id', Auth::user ()->applicant->id)
65
+            ->where ('job_poster_id', $jobPoster->id)->first ();
66 66
         if ($application == null) {
67
-            $application = new JobApplication();
67
+            $application = new JobApplication ();
68 68
             $application->job_poster_id = $jobPoster->id;
69
-            $application->applicant_id = Auth::user()->applicant->id;
70
-            $application->application_status_id = ApplicationStatus::where('name', 'draft')->firstOrFail()->id;
71
-            $application->save();
69
+            $application->applicant_id = Auth::user ()->applicant->id;
70
+            $application->application_status_id = ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id;
71
+            $application->save ();
72 72
         }
73 73
         return $application;
74 74
     }
@@ -81,32 +81,32 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function editBasics(JobPoster $jobPoster)
83 83
     {
84
-        $applicant = Auth::user()->applicant;
85
-        $application = $this->getApplicationFromJob($jobPoster);
84
+        $applicant = Auth::user ()->applicant;
85
+        $application = $this->getApplicationFromJob ($jobPoster);
86 86
 
87 87
         // Ensure user has permissions to view and update application.
88
-        $this->authorize('view', $application);
89
-        $this->authorize('update', $application);
88
+        $this->authorize ('view', $application);
89
+        $this->authorize ('update', $application);
90 90
 
91
-        return view(
91
+        return view (
92 92
             'applicant/application_post_01',
93 93
             [
94 94
                 // Application Template Data.
95 95
                 'application_step' => 1,
96
-                'application_template' => Lang::get('applicant/application_template'),
97
-                'language_options' => PreferredLanguage::all(),
98
-                'citizenship_options' => CitizenshipDeclaration::all(),
99
-                'veteran_options' => VeteranStatus::all(),
100
-                'preferred_language_template' => Lang::get('common/preferred_language'),
101
-                'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'),
102
-                'veteran_status_template' => Lang::get('common/veteran_status'),
96
+                'application_template' => Lang::get ('applicant/application_template'),
97
+                'language_options' => PreferredLanguage::all (),
98
+                'citizenship_options' => CitizenshipDeclaration::all (),
99
+                'veteran_options' => VeteranStatus::all (),
100
+                'preferred_language_template' => Lang::get ('common/preferred_language'),
101
+                'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'),
102
+                'veteran_status_template' => Lang::get ('common/veteran_status'),
103 103
                 // Job Data.
104 104
                 'job' => $jobPoster,
105 105
                 // Applicant Data.
106 106
                 'applicant' => $applicant,
107 107
                 'job_application' => $application,
108 108
                 // Submission.
109
-                'form_submit_action' => route('job.application.update.1', $jobPoster)
109
+                'form_submit_action' => route ('job.application.update.1', $jobPoster)
110 110
             ]
111 111
         );
112 112
     }
@@ -119,26 +119,26 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function editExperience(JobPoster $jobPoster)
121 121
     {
122
-        $applicant = Auth::user()->applicant;
123
-        $application = $this->getApplicationFromJob($jobPoster);
122
+        $applicant = Auth::user ()->applicant;
123
+        $application = $this->getApplicationFromJob ($jobPoster);
124 124
 
125 125
         // Ensure user has permissions to view and update application.
126
-        $this->authorize('view', $application);
127
-        $this->authorize('update', $application);
126
+        $this->authorize ('view', $application);
127
+        $this->authorize ('update', $application);
128 128
 
129
-        return view(
129
+        return view (
130 130
             'applicant/application_post_02',
131 131
             [
132 132
                 // Application Template Data.
133 133
                 'application_step' => 2,
134
-                'application_template' => Lang::get('applicant/application_template'),
134
+                'application_template' => Lang::get ('applicant/application_template'),
135 135
                 // Job Data.
136 136
                 'job' => $jobPoster,
137 137
                 // Applicant Data.
138 138
                 'applicant' => $applicant,
139 139
                 'job_application' => $application,
140 140
                 // Submission.
141
-                'form_submit_action' => route('job.application.update.2', $jobPoster)
141
+                'form_submit_action' => route ('job.application.update.2', $jobPoster)
142 142
             ]
143 143
         );
144 144
     }
@@ -151,39 +151,39 @@  discard block
 block discarded – undo
151 151
      */
152 152
     public function editEssentialSkills(JobPoster $jobPoster)
153 153
     {
154
-        $applicant = Auth::user()->applicant;
155
-        $application = $this->getApplicationFromJob($jobPoster);
154
+        $applicant = Auth::user ()->applicant;
155
+        $application = $this->getApplicationFromJob ($jobPoster);
156 156
 
157 157
         // Ensure user has permissions to view and update application.
158
-        $this->authorize('view', $application);
159
-        $this->authorize('update', $application);
158
+        $this->authorize ('view', $application);
159
+        $this->authorize ('update', $application);
160 160
 
161 161
         $criteria = [
162
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
162
+            'essential' => $jobPoster->criteria->filter (function ($value, $key){
163 163
                 return $value->criteria_type->name == 'essential';
164 164
             }),
165
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
165
+            'asset' => $jobPoster->criteria->filter (function ($value, $key){
166 166
                 return $value->criteria_type->name == 'asset';
167 167
             }),
168 168
         ];
169 169
 
170
-        return view(
170
+        return view (
171 171
             'applicant/application_post_03',
172 172
             [
173 173
                 // Application Template Data.
174 174
                 'application_step' => 3,
175
-                'application_template' => Lang::get('applicant/application_template'),
175
+                'application_template' => Lang::get ('applicant/application_template'),
176 176
                 // Job Data.
177 177
                 'job' => $jobPoster,
178 178
                 // Skills Data.
179
-                'skills' => Skill::all(),
180
-                'skill_template' => Lang::get('common/skills'),
179
+                'skills' => Skill::all (),
180
+                'skill_template' => Lang::get ('common/skills'),
181 181
                 'criteria' => $criteria,
182 182
                 // Applicant Data.
183 183
                 'applicant' => $applicant,
184 184
                 'job_application' => $application,
185 185
                 // Submission.
186
-                'form_submit_action' => route('job.application.update.3', $jobPoster)
186
+                'form_submit_action' => route ('job.application.update.3', $jobPoster)
187 187
             ]
188 188
         );
189 189
     }
@@ -196,39 +196,39 @@  discard block
 block discarded – undo
196 196
      */
197 197
     public function editAssetSkills(JobPoster $jobPoster)
198 198
     {
199
-        $applicant = Auth::user()->applicant;
200
-        $application = $this->getApplicationFromJob($jobPoster);
199
+        $applicant = Auth::user ()->applicant;
200
+        $application = $this->getApplicationFromJob ($jobPoster);
201 201
 
202 202
         // Ensure user has permissions to view and update application.
203
-        $this->authorize('view', $application);
204
-        $this->authorize('update', $application);
203
+        $this->authorize ('view', $application);
204
+        $this->authorize ('update', $application);
205 205
 
206 206
         $criteria = [
207
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
207
+            'essential' => $jobPoster->criteria->filter (function ($value, $key){
208 208
                 return $value->criteria_type->name == 'essential';
209 209
             }),
210
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
210
+            'asset' => $jobPoster->criteria->filter (function ($value, $key){
211 211
                 return $value->criteria_type->name == 'asset';
212 212
             }),
213 213
         ];
214 214
 
215
-        return view(
215
+        return view (
216 216
             'applicant/application_post_04',
217 217
             [
218 218
                 // Application Template Data.
219 219
                 'application_step' => 4,
220
-                'application_template' => Lang::get('applicant/application_template'),
220
+                'application_template' => Lang::get ('applicant/application_template'),
221 221
                 // Job Data.
222 222
                 'job' => $jobPoster,
223 223
                 // Skills Data.
224
-                'skills' => Skill::all(),
225
-                'skill_template' => Lang::get('common/skills'),
224
+                'skills' => Skill::all (),
225
+                'skill_template' => Lang::get ('common/skills'),
226 226
                 'criteria' => $criteria,
227 227
                 // Applicant Data.
228 228
                 'applicant' => $applicant,
229 229
                 'job_application' => $application,
230 230
                 // Submission.
231
-                'form_submit_action' => route('job.application.update.4', $jobPoster)
231
+                'form_submit_action' => route ('job.application.update.4', $jobPoster)
232 232
             ]
233 233
         );
234 234
     }
@@ -241,38 +241,38 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function preview(JobPoster $jobPoster)
243 243
     {
244
-        $applicant = Auth::user()->applicant;
245
-        $application = $this->getApplicationFromJob($jobPoster);
244
+        $applicant = Auth::user ()->applicant;
245
+        $application = $this->getApplicationFromJob ($jobPoster);
246 246
 
247
-        $this->authorize('view', $application);
247
+        $this->authorize ('view', $application);
248 248
         $criteria = [
249
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
249
+            'essential' => $jobPoster->criteria->filter (function ($value, $key){
250 250
                 return $value->criteria_type->name == 'essential';
251 251
             }),
252
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
252
+            'asset' => $jobPoster->criteria->filter (function ($value, $key){
253 253
                 return $value->criteria_type->name == 'asset';
254 254
             }),
255 255
         ];
256 256
 
257
-        return view(
257
+        return view (
258 258
             'applicant/application_post_05',
259 259
             [
260 260
                 // Application Template Data.
261 261
                 'application_step' => 5,
262
-                'application_template' => Lang::get('applicant/application_template'),
263
-                'preferred_language_template' => Lang::get('common/preferred_language'),
264
-                'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'),
265
-                'veteran_status_template' => Lang::get('common/veteran_status'),
262
+                'application_template' => Lang::get ('applicant/application_template'),
263
+                'preferred_language_template' => Lang::get ('common/preferred_language'),
264
+                'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'),
265
+                'veteran_status_template' => Lang::get ('common/veteran_status'),
266 266
                 // Job Data.
267 267
                 'job' => $jobPoster,
268 268
                 // Skills Data.
269
-                'skills' => Skill::all(),
270
-                'skill_template' => Lang::get('common/skills'),
269
+                'skills' => Skill::all (),
270
+                'skill_template' => Lang::get ('common/skills'),
271 271
                 'criteria' => $criteria,
272 272
                 // Applicant Data.
273 273
                 'applicant' => $applicant,
274 274
                 'job_application' => $application,
275
-                'is_manager_view' => WhichPortal::isManagerPortal(),
275
+                'is_manager_view' => WhichPortal::isManagerPortal (),
276 276
             ]
277 277
         );
278 278
     }
@@ -285,22 +285,22 @@  discard block
 block discarded – undo
285 285
      */
286 286
     public function confirm(JobPoster $jobPoster)
287 287
     {
288
-        $applicant = Auth::user()->applicant;
289
-        $application = $this->getApplicationFromJob($jobPoster);
288
+        $applicant = Auth::user ()->applicant;
289
+        $application = $this->getApplicationFromJob ($jobPoster);
290 290
 
291
-        $this->authorize('update', $application);
291
+        $this->authorize ('update', $application);
292 292
 
293
-        return view(
293
+        return view (
294 294
             'applicant/application_post_06',
295 295
             [
296 296
                 // Application Template Data.
297 297
                 'application_step' => 6,
298
-                'application_template' => Lang::get('applicant/application_template'),
298
+                'application_template' => Lang::get ('applicant/application_template'),
299 299
                 // Used by tracker partial.
300 300
                 'job' => $jobPoster,
301 301
                 'job_application' => $application,
302 302
                 // Submission.
303
-                'form_submit_action' => route('job.application.submit', $jobPoster)
303
+                'form_submit_action' => route ('job.application.submit', $jobPoster)
304 304
             ]
305 305
         );
306 306
     }
@@ -314,19 +314,19 @@  discard block
 block discarded – undo
314 314
     public function complete(JobPoster $jobPoster)
315 315
     {
316 316
         // Include Applicant Data.
317
-        $applicant = Auth::user()->applicant;
317
+        $applicant = Auth::user ()->applicant;
318 318
         // Include Application Data.
319
-        $application = $this->getApplicationFromJob($jobPoster);
319
+        $application = $this->getApplicationFromJob ($jobPoster);
320 320
 
321 321
         // Ensure user has permissions to view application.
322
-        $this->authorize('view', $application);
322
+        $this->authorize ('view', $application);
323 323
 
324 324
         // Return the Completion View.
325
-        return view(
325
+        return view (
326 326
             'applicant/application_post_complete',
327 327
             [
328 328
                 // Application Template Data.
329
-                'application_template' => Lang::get('applicant/application_template'),
329
+                'application_template' => Lang::get ('applicant/application_template'),
330 330
                 // Job Data.
331 331
                 'job' => $jobPoster,
332 332
                 // Applicant Data.
@@ -345,50 +345,50 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public function updateBasics(Request $request, JobPoster $jobPoster)
347 347
     {
348
-        $applicant = Auth::user()->applicant;
349
-        $application = $this->getApplicationFromJob($jobPoster);
348
+        $applicant = Auth::user ()->applicant;
349
+        $application = $this->getApplicationFromJob ($jobPoster);
350 350
 
351 351
         // Ensure user has permissions to update this application.
352
-        $this->authorize('update', $application);
352
+        $this->authorize ('update', $application);
353 353
 
354
-        $application->fill([
355
-            'citizenship_declaration_id' => $request->input('citizenship_declaration_id'),
356
-            'veteran_status_id' => $request->input('veteran_status_id'),
357
-            'preferred_language_id' => $request->input('preferred_language_id'),
358
-            'language_requirement_confirmed' => $request->input('language_requirement_confirmed')
354
+        $application->fill ([
355
+            'citizenship_declaration_id' => $request->input ('citizenship_declaration_id'),
356
+            'veteran_status_id' => $request->input ('veteran_status_id'),
357
+            'preferred_language_id' => $request->input ('preferred_language_id'),
358
+            'language_requirement_confirmed' => $request->input ('language_requirement_confirmed')
359 359
         ]);
360
-        $application->save();
360
+        $application->save ();
361 361
 
362 362
         $questions = $jobPoster->job_poster_questions;
363
-        $questionsInput = $request->input('questions');
363
+        $questionsInput = $request->input ('questions');
364 364
         foreach ($questions as $question) {
365 365
             $answer = null;
366 366
             if (isset($questionsInput[$question->id])) {
367 367
                 $answer = $questionsInput[$question->id];
368 368
             }
369 369
             $answerObj = $application->job_application_answers
370
-            ->firstWhere('job_poster_question_id', $question->id);
370
+            ->firstWhere ('job_poster_question_id', $question->id);
371 371
             if ($answerObj == null) {
372
-                $answerObj = new JobApplicationAnswer();
372
+                $answerObj = new JobApplicationAnswer ();
373 373
                 $answerObj->job_poster_question_id = $question->id;
374 374
                 $answerObj->job_application_id = $application->id;
375 375
             }
376 376
             $answerObj->answer = $answer;
377
-            $answerObj->save();
377
+            $answerObj->save ();
378 378
         }
379 379
 
380 380
         // Redirect to correct page.
381
-        switch ($request->input('submit')) {
381
+        switch ($request->input ('submit')) {
382 382
             case 'save_and_quit':
383 383
             case 'previous':
384
-                return redirect()->route('applications.index');
384
+                return redirect ()->route ('applications.index');
385 385
                 break;
386 386
             case 'save_and_continue':
387 387
             case 'next':
388
-                return redirect()->route('job.application.edit.2', $jobPoster);
388
+                return redirect ()->route ('job.application.edit.2', $jobPoster);
389 389
                 break;
390 390
             default:
391
-                return redirect()->back()->withInput();
391
+                return redirect ()->back ()->withInput ();
392 392
         }
393 393
     }
394 394
 
@@ -401,19 +401,19 @@  discard block
 block discarded – undo
401 401
      */
402 402
     public function updateExperience(Request $request, JobPoster $jobPoster)
403 403
     {
404
-        $applicant = Auth::user()->applicant;
405
-        $application = $this->getApplicationFromJob($jobPoster);
404
+        $applicant = Auth::user ()->applicant;
405
+        $application = $this->getApplicationFromJob ($jobPoster);
406 406
 
407 407
         // Ensure user has permissions to update this application.
408
-        $this->authorize('update', $application);
408
+        $this->authorize ('update', $application);
409 409
 
410 410
         // Record that the user has saved their experience for this application.
411 411
         $application->experience_saved = true;
412
-        $application->save();
412
+        $application->save ();
413 413
 
414
-        $degrees = $request->input('degrees');
414
+        $degrees = $request->input ('degrees');
415 415
 
416
-        $request->validate([
416
+        $request->validate ([
417 417
             'degrees.new.*.degree_type_id' => 'required',
418 418
             'degrees.new.*.area_of_study'  => 'required',
419 419
             'degrees.new.*.institution'    => 'required',
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
         // Save new degrees.
427 427
         if (isset($degrees['new'])) {
428 428
             foreach ($degrees['new'] as $degreeInput) {
429
-                $degree = new Degree();
429
+                $degree = new Degree ();
430 430
                 $degree->applicant_id = $applicant->id;
431
-                $degree->fill([
431
+                $degree->fill ([
432 432
                     'degree_type_id' => $degreeInput['degree_type_id'],
433 433
                     'area_of_study' => $degreeInput['area_of_study'],
434 434
                     'institution' => $degreeInput['institution'],
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                     'end_date' => $degreeInput['end_date'],
438 438
                     'blockcert_url' => $degreeInput['blockcert_url'],
439 439
                 ]);
440
-                $degree->save();
440
+                $degree->save ();
441 441
             }
442 442
         }
443 443
 
@@ -445,9 +445,9 @@  discard block
 block discarded – undo
445 445
         if (isset($degrees['old'])) {
446 446
             foreach ($degrees['old'] as $id => $degreeInput) {
447 447
                 // Ensure this degree belongs to this applicant.
448
-                $degree = $applicant->degrees->firstWhere('id', $id);
448
+                $degree = $applicant->degrees->firstWhere ('id', $id);
449 449
                 if ($degree != null) {
450
-                    $degree->fill([
450
+                    $degree->fill ([
451 451
                         'degree_type_id' => $degreeInput['degree_type_id'],
452 452
                         'area_of_study' => $degreeInput['area_of_study'],
453 453
                         'institution' => $degreeInput['institution'],
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
                         'end_date' => $degreeInput['end_date'],
457 457
                         'blockcert_url' => $degreeInput['blockcert_url'],
458 458
                     ]);
459
-                    $degree->save();
459
+                    $degree->save ();
460 460
                 } else {
461
-                    Log::warning("Applicant $applicant->id attempted to update degree with invalid id: $id");
461
+                    Log::warning ("Applicant $applicant->id attempted to update degree with invalid id: $id");
462 462
                 }
463 463
             }
464 464
         }
465 465
 
466
-        $courses = $request->input('courses');
466
+        $courses = $request->input ('courses');
467 467
 
468
-        $request->validate([
468
+        $request->validate ([
469 469
             'courses.new.*.name'             => 'required',
470 470
             'courses.new.*.institution'      => 'required',
471 471
             'courses.new.*.course_status_id' => 'required',
@@ -476,16 +476,16 @@  discard block
 block discarded – undo
476 476
         // Save new courses.
477 477
         if (isset($courses['new'])) {
478 478
             foreach ($courses['new'] as $courseInput) {
479
-                $course = new Course();
479
+                $course = new Course ();
480 480
                 $course->applicant_id = $applicant->id;
481
-                $course->fill([
481
+                $course->fill ([
482 482
                     'name' => $courseInput['name'],
483 483
                     'institution' => $courseInput['institution'],
484 484
                     'course_status_id' => $courseInput['course_status_id'],
485 485
                     'start_date' => $courseInput['start_date'],
486 486
                     'end_date' => $courseInput['end_date']
487 487
                 ]);
488
-                $course->save();
488
+                $course->save ();
489 489
             }
490 490
         }
491 491
 
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
         if (isset($courses['old'])) {
494 494
             foreach ($courses['old'] as $id => $courseInput) {
495 495
                 // Ensure this course belongs to this applicant.
496
-                $course = $applicant->courses->firstWhere('id', $id);
496
+                $course = $applicant->courses->firstWhere ('id', $id);
497 497
                 if ($course != null) {
498
-                    $course->fill([
498
+                    $course->fill ([
499 499
                         'name' => $courseInput['name'],
500 500
                         'institution' => $courseInput['institution'],
501 501
                         'course_status_id' => $courseInput['course_status_id'],
502 502
                         'start_date' => $courseInput['start_date'],
503 503
                         'end_date' => $courseInput['end_date']
504 504
                     ]);
505
-                    $course->save();
505
+                    $course->save ();
506 506
                 } else {
507
-                    Log::warning("Applicant $applicant->id attempted to update course with invalid id: $id");
507
+                    Log::warning ("Applicant $applicant->id attempted to update course with invalid id: $id");
508 508
                 }
509 509
             }
510 510
         }
511 511
 
512
-        $work_experiences = $request->input('work_experiences');
512
+        $work_experiences = $request->input ('work_experiences');
513 513
 
514
-        $request->validate([
514
+        $request->validate ([
515 515
             'work_experiences.new.*.role'        => 'required',
516 516
             'work_experiences.new.*.company'     => 'required',
517 517
             'work_experiences.new.*.description' => 'required',
@@ -522,16 +522,16 @@  discard block
 block discarded – undo
522 522
         // Save new work_experiences.
523 523
         if (isset($work_experiences['new'])) {
524 524
             foreach ($work_experiences['new'] as $workExperienceInput) {
525
-                $workExperience = new WorkExperience();
525
+                $workExperience = new WorkExperience ();
526 526
                 $workExperience->applicant_id = $applicant->id;
527
-                $workExperience->fill([
527
+                $workExperience->fill ([
528 528
                     'role' => $workExperienceInput['role'],
529 529
                     'company' => $workExperienceInput['company'],
530 530
                     'description' => $workExperienceInput['description'],
531 531
                     'start_date' => $workExperienceInput['start_date'],
532 532
                     'end_date' => $workExperienceInput['end_date']
533 533
                 ]);
534
-                $workExperience->save();
534
+                $workExperience->save ();
535 535
             }
536 536
         }
537 537
 
@@ -539,36 +539,36 @@  discard block
 block discarded – undo
539 539
         if (isset($work_experiences['old'])) {
540 540
             foreach ($work_experiences['old'] as $id => $workExperienceInput) {
541 541
                 // Ensure this work_experience belongs to this applicant.
542
-                $workExperience = $applicant->work_experiences->firstWhere('id', $id);
542
+                $workExperience = $applicant->work_experiences->firstWhere ('id', $id);
543 543
                 if ($workExperience != null) {
544
-                    $workExperience->fill([
544
+                    $workExperience->fill ([
545 545
                         'role' => $workExperienceInput['role'],
546 546
                         'company' => $workExperienceInput['company'],
547 547
                         'description' => $workExperienceInput['description'],
548 548
                         'start_date' => $workExperienceInput['start_date'],
549 549
                         'end_date' => $workExperienceInput['end_date']
550 550
                     ]);
551
-                    $workExperience->save();
551
+                    $workExperience->save ();
552 552
                 } else {
553
-                    Log::warning("Applicant $applicant->id attempted to update work_experience with invalid id: $id");
553
+                    Log::warning ("Applicant $applicant->id attempted to update work_experience with invalid id: $id");
554 554
                 }
555 555
             }
556 556
         }
557 557
 
558 558
         // Redirect to correct page.
559
-        switch ($request->input('submit')) {
559
+        switch ($request->input ('submit')) {
560 560
             case 'save_and_quit':
561
-                return redirect()->route('applications.index');
561
+                return redirect ()->route ('applications.index');
562 562
                 break;
563 563
             case 'save_and_continue':
564 564
             case 'next':
565
-                return redirect()->route('job.application.edit.3', $jobPoster);
565
+                return redirect ()->route ('job.application.edit.3', $jobPoster);
566 566
                 break;
567 567
             case 'previous':
568
-                return redirect()->route('job.application.edit.1', $jobPoster);
568
+                return redirect ()->route ('job.application.edit.1', $jobPoster);
569 569
                 break;
570 570
             default:
571
-                return redirect()->back()->withInput();
571
+                return redirect ()->back ()->withInput ();
572 572
         }
573 573
     }
574 574
 
@@ -581,34 +581,34 @@  discard block
 block discarded – undo
581 581
      */
582 582
     public function updateEssentialSkills(Request $request, JobPoster $jobPoster)
583 583
     {
584
-        $applicant = Auth::user()->applicant;
585
-        $application = $this->getApplicationFromJob($jobPoster);
584
+        $applicant = Auth::user ()->applicant;
585
+        $application = $this->getApplicationFromJob ($jobPoster);
586 586
 
587 587
         // Ensure user has permissions to update this application.
588
-        $this->authorize('update', $application);
588
+        $this->authorize ('update', $application);
589 589
 
590
-        $skillDeclarations = $request->input('skill_declarations');
591
-        $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id;
590
+        $skillDeclarations = $request->input ('skill_declarations');
591
+        $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id;
592 592
 
593 593
         // Save new skill declarartions.
594 594
         if (isset($skillDeclarations['new'])) {
595 595
             foreach ($skillDeclarations['new'] as $skillType => $typeInput) {
596 596
                 foreach ($typeInput as $criterion_id => $skillDeclarationInput) {
597
-                    $skillDeclaration = new SkillDeclaration();
597
+                    $skillDeclaration = new SkillDeclaration ();
598 598
                     $skillDeclaration->applicant_id = $applicant->id;
599
-                    $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id;
599
+                    $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id;
600 600
                     $skillDeclaration->skill_status_id = $claimedStatusId;
601
-                    $skillDeclaration->fill([
601
+                    $skillDeclaration->fill ([
602 602
                         'description' => $skillDeclarationInput['description'],
603 603
                         'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
604 604
                     ]);
605
-                    $skillDeclaration->save();
605
+                    $skillDeclaration->save ();
606 606
 
607
-                    $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
608
-                    $skillDeclaration->references()->sync($referenceIds);
607
+                    $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
608
+                    $skillDeclaration->references ()->sync ($referenceIds);
609 609
 
610
-                    $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
611
-                    $skillDeclaration->work_samples()->sync($sampleIds);
610
+                    $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
611
+                    $skillDeclaration->work_samples ()->sync ($sampleIds);
612 612
                 }
613 613
             }
614 614
         }
@@ -618,41 +618,41 @@  discard block
 block discarded – undo
618 618
             foreach ($skillDeclarations['old'] as $skillType => $typeInput) {
619 619
                 foreach ($typeInput as $id => $skillDeclarationInput) {
620 620
                     // Ensure this declaration belongs to this applicant.
621
-                    $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id);
621
+                    $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id);
622 622
                     if ($skillDeclaration != null) {
623 623
                         // skill_id and skill_status cannot be changed.
624
-                        $skillDeclaration->fill([
624
+                        $skillDeclaration->fill ([
625 625
                             'description' => $skillDeclarationInput['description'],
626 626
                             'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
627 627
                         ]);
628
-                        $skillDeclaration->save();
628
+                        $skillDeclaration->save ();
629 629
 
630
-                        $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
631
-                        $skillDeclaration->references()->sync($referenceIds);
630
+                        $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
631
+                        $skillDeclaration->references ()->sync ($referenceIds);
632 632
 
633
-                        $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
634
-                        $skillDeclaration->work_samples()->sync($sampleIds);
633
+                        $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
634
+                        $skillDeclaration->work_samples ()->sync ($sampleIds);
635 635
                     } else {
636
-                        Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
636
+                        Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
637 637
                     }
638 638
                 }
639 639
             }
640 640
         }
641 641
 
642 642
         // Redirect to correct page.
643
-        switch ($request->input('submit')) {
643
+        switch ($request->input ('submit')) {
644 644
             case 'save_and_quit':
645
-                return redirect()->route('applications.index');
645
+                return redirect ()->route ('applications.index');
646 646
                 break;
647 647
             case 'save_and_continue':
648 648
             case 'next':
649
-                return redirect()->route('job.application.edit.4', $jobPoster);
649
+                return redirect ()->route ('job.application.edit.4', $jobPoster);
650 650
                 break;
651 651
             case 'previous':
652
-                return redirect()->route('job.application.edit.2', $jobPoster);
652
+                return redirect ()->route ('job.application.edit.2', $jobPoster);
653 653
                 break;
654 654
             default:
655
-                return redirect()->back()->withInput();
655
+                return redirect ()->back ()->withInput ();
656 656
         }
657 657
     }
658 658
 
@@ -665,34 +665,34 @@  discard block
 block discarded – undo
665 665
      */
666 666
     public function updateAssetSkills(Request $request, JobPoster $jobPoster)
667 667
     {
668
-        $applicant = Auth::user()->applicant;
669
-        $application = $this->getApplicationFromJob($jobPoster);
668
+        $applicant = Auth::user ()->applicant;
669
+        $application = $this->getApplicationFromJob ($jobPoster);
670 670
 
671 671
         // Ensure user has permissions to update this application.
672
-        $this->authorize('update', $application);
672
+        $this->authorize ('update', $application);
673 673
 
674
-        $skillDeclarations = $request->input('skill_declarations');
675
-        $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id;
674
+        $skillDeclarations = $request->input ('skill_declarations');
675
+        $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id;
676 676
 
677 677
         // Save new skill declarartions.
678 678
         if (isset($skillDeclarations['new'])) {
679 679
             foreach ($skillDeclarations['new'] as $skillType => $typeInput) {
680 680
                 foreach ($typeInput as $criterion_id => $skillDeclarationInput) {
681
-                    $skillDeclaration = new SkillDeclaration();
681
+                    $skillDeclaration = new SkillDeclaration ();
682 682
                     $skillDeclaration->applicant_id = $applicant->id;
683
-                    $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id;
683
+                    $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id;
684 684
                     $skillDeclaration->skill_status_id = $claimedStatusId;
685
-                    $skillDeclaration->fill([
685
+                    $skillDeclaration->fill ([
686 686
                         'description' => $skillDeclarationInput['description'],
687 687
                         'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
688 688
                     ]);
689
-                    $skillDeclaration->save();
689
+                    $skillDeclaration->save ();
690 690
 
691
-                    $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
692
-                    $skillDeclaration->references()->sync($referenceIds);
691
+                    $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
692
+                    $skillDeclaration->references ()->sync ($referenceIds);
693 693
 
694
-                    $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
695
-                    $skillDeclaration->work_samples()->sync($sampleIds);
694
+                    $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
695
+                    $skillDeclaration->work_samples ()->sync ($sampleIds);
696 696
                 }
697 697
             }
698 698
         }
@@ -702,41 +702,41 @@  discard block
 block discarded – undo
702 702
             foreach ($skillDeclarations['old'] as $skillType => $typeInput) {
703 703
                 foreach ($typeInput as $id => $skillDeclarationInput) {
704 704
                     // Ensure this declaration belongs to this applicant.
705
-                    $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id);
705
+                    $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id);
706 706
                     if ($skillDeclaration != null) {
707 707
                         // skill_id and skill_status cannot be changed.
708
-                        $skillDeclaration->fill([
708
+                        $skillDeclaration->fill ([
709 709
                             'description' => $skillDeclarationInput['description'],
710 710
                             'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
711 711
                         ]);
712
-                        $skillDeclaration->save();
712
+                        $skillDeclaration->save ();
713 713
 
714
-                        $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
715
-                        $skillDeclaration->references()->sync($referenceIds);
714
+                        $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
715
+                        $skillDeclaration->references ()->sync ($referenceIds);
716 716
 
717
-                        $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
718
-                        $skillDeclaration->work_samples()->sync($sampleIds);
717
+                        $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
718
+                        $skillDeclaration->work_samples ()->sync ($sampleIds);
719 719
                     } else {
720
-                        Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
720
+                        Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
721 721
                     }
722 722
                 }
723 723
             }
724 724
         }
725 725
 
726 726
         // Redirect to correct page.
727
-        switch ($request->input('submit')) {
727
+        switch ($request->input ('submit')) {
728 728
             case 'save_and_quit':
729
-                return redirect()->route('applications.index');
729
+                return redirect ()->route ('applications.index');
730 730
                 break;
731 731
             case 'save_and_continue':
732 732
             case 'next':
733
-                return redirect()->route('job.application.edit.5', $jobPoster);
733
+                return redirect ()->route ('job.application.edit.5', $jobPoster);
734 734
                 break;
735 735
             case 'previous':
736
-                return redirect()->route('job.application.edit.3', $jobPoster);
736
+                return redirect ()->route ('job.application.edit.3', $jobPoster);
737 737
                 break;
738 738
             default:
739
-                return redirect()->back()->withInput();
739
+                return redirect ()->back ()->withInput ();
740 740
         }
741 741
     }
742 742
 
@@ -749,15 +749,15 @@  discard block
 block discarded – undo
749 749
      */
750 750
     public function submit(Request $request, JobPoster $jobPoster)
751 751
     {
752
-        $applicant = Auth::user()->applicant;
753
-        $application = $this->getApplicationFromJob($jobPoster);
752
+        $applicant = Auth::user ()->applicant;
753
+        $application = $this->getApplicationFromJob ($jobPoster);
754 754
 
755 755
         // Ensure user has permissions to update this application.
756
-        $this->authorize('update', $application);
756
+        $this->authorize ('update', $application);
757 757
 
758 758
         // Only complete submission if submit button was pressed.
759
-        if ($request->input('submit') == 'submit') {
760
-            $request->validate([
759
+        if ($request->input ('submit') == 'submit') {
760
+            $request->validate ([
761 761
                 'submission_signature' => [
762 762
                     'required',
763 763
                     'string',
@@ -771,33 +771,33 @@  discard block
 block discarded – undo
771 771
             ]);
772 772
 
773 773
             // Save any final info.
774
-            $application->fill([
775
-                'submission_signature' => $request->input('submission_signature'),
776
-                'submission_date' => $request->input('submission_date'),
774
+            $application->fill ([
775
+                'submission_signature' => $request->input ('submission_signature'),
776
+                'submission_date' => $request->input ('submission_date'),
777 777
             ]);
778 778
 
779
-            $validator = new ApplicationValidator();
780
-            $validator->validate($application);
779
+            $validator = new ApplicationValidator ();
780
+            $validator->validate ($application);
781 781
 
782 782
             // Change status to 'submitted'.
783
-            $application->application_status_id = ApplicationStatus::where('name', 'submitted')->firstOrFail()->id;
783
+            $application->application_status_id = ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id;
784 784
         }
785 785
 
786
-        $application->save();
786
+        $application->save ();
787 787
 
788 788
         // Redirect to correct page.
789
-        switch ($request->input('submit')) {
789
+        switch ($request->input ('submit')) {
790 790
             case 'save_and_quit':
791
-                return redirect()->route('applications.index');
791
+                return redirect ()->route ('applications.index');
792 792
                 break;
793 793
             case 'submit':
794
-                return redirect()->route('job.application.complete', $jobPoster);
794
+                return redirect ()->route ('job.application.complete', $jobPoster);
795 795
                 break;
796 796
             case 'previous':
797
-                return redirect()->route('job.application.edit.4', $jobPoster);
797
+                return redirect ()->route ('job.application.edit.4', $jobPoster);
798 798
                 break;
799 799
             default:
800
-                return redirect()->back()->withInput();
800
+                return redirect ()->back ()->withInput ();
801 801
         }
802 802
     }
803 803
 }
Please login to merge, or discard this patch.
app/Http/Controllers/RatingGuideQuestionController.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -19,29 +19,29 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function store(Request $request)
21 21
     {
22
-        $this->authorize('create', RatingGuideQuestion::class);
22
+        $this->authorize ('create', RatingGuideQuestion::class);
23 23
 
24
-        $job_poster_id = (int)$request->json('job_poster_id');
25
-        $assessment_type_id = (int)$request->json('assessment_type_id');
26
-        $question = $request->json('question');
24
+        $job_poster_id = (int)$request->json ('job_poster_id');
25
+        $assessment_type_id = (int)$request->json ('assessment_type_id');
26
+        $question = $request->json ('question');
27 27
 
28
-        JobPoster::findOrFail($job_poster_id);
29
-        AssessmentType::findOrFail($assessment_type_id);
28
+        JobPoster::findOrFail ($job_poster_id);
29
+        AssessmentType::findOrFail ($assessment_type_id);
30 30
 
31
-        $ratingGuideQuestion = new RatingGuideQuestion([
31
+        $ratingGuideQuestion = new RatingGuideQuestion ([
32 32
             'job_poster_id' => $job_poster_id,
33 33
             'assessment_type_id' => $assessment_type_id,
34 34
             'question' => $question,
35 35
         ]);
36 36
         // Check that this user is allowed to create an Assessment for this criterion.
37
-        $this->authorize('update', $ratingGuideQuestion);
37
+        $this->authorize ('update', $ratingGuideQuestion);
38 38
 
39
-        $ratingGuideQuestion->save();
40
-        $ratingGuideQuestion->refresh();
39
+        $ratingGuideQuestion->save ();
40
+        $ratingGuideQuestion->refresh ();
41 41
 
42 42
         return [
43 43
             'success' => "Successfully created rating guide question $ratingGuideQuestion->id",
44
-            'rating_guide_question' => $ratingGuideQuestion->toArray(),
44
+            'rating_guide_question' => $ratingGuideQuestion->toArray (),
45 45
         ];
46 46
     }
47 47
 
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function show(RatingGuideQuestion $ratingGuideQuestion)
55 55
     {
56
-        $this->authorize('view', $ratingGuideQuestion);
57
-        $ratingGuideQuestion->load([
56
+        $this->authorize ('view', $ratingGuideQuestion);
57
+        $ratingGuideQuestion->load ([
58 58
             'job_poster',
59 59
             'assessment_type'
60 60
         ]);
61
-        return $ratingGuideQuestion->toArray();
61
+        return $ratingGuideQuestion->toArray ();
62 62
     }
63 63
 
64 64
     /**
@@ -71,23 +71,23 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function update(Request $request, RatingGuideQuestion $ratingGuideQuestion)
73 73
     {
74
-        $this->authorize('update', $ratingGuideQuestion);
74
+        $this->authorize ('update', $ratingGuideQuestion);
75 75
 
76
-        $job_poster_id = (int)$request->json('job_poster_id');
77
-        $assessment_type_id = (int)$request->json('assessment_type_id');
78
-        $question = $request->json('question');
76
+        $job_poster_id = (int)$request->json ('job_poster_id');
77
+        $assessment_type_id = (int)$request->json ('assessment_type_id');
78
+        $question = $request->json ('question');
79 79
 
80
-        JobPoster::findOrFail($job_poster_id);
81
-        AssessmentType::findOrFail($assessment_type_id);
80
+        JobPoster::findOrFail ($job_poster_id);
81
+        AssessmentType::findOrFail ($assessment_type_id);
82 82
 
83 83
         $ratingGuideQuestion->job_poster_id = $job_poster_id;
84 84
         $ratingGuideQuestion->assessment_type_id = $assessment_type_id;
85 85
         $ratingGuideQuestion->question = $question;
86
-        $ratingGuideQuestion->save();
86
+        $ratingGuideQuestion->save ();
87 87
 
88 88
         return [
89 89
             'success' => "Successfully updated rating guide question $ratingGuideQuestion->id",
90
-            'rating_guide_question' => $ratingGuideQuestion->toArray(),
90
+            'rating_guide_question' => $ratingGuideQuestion->toArray (),
91 91
         ];
92 92
     }
93 93
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function destroy(RatingGuideQuestion $ratingGuideQuestion)
101 101
     {
102
-        $this->authorize('delete', $ratingGuideQuestion);
103
-        $ratingGuideQuestion->delete();
102
+        $this->authorize ('delete', $ratingGuideQuestion);
103
+        $ratingGuideQuestion->delete ();
104 104
 
105 105
         return [
106 106
             'success' => "Successfully deleted rating guide question $ratingGuideQuestion->id"
Please login to merge, or discard this patch.
app/Http/Controllers/JobController.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function index()
25 25
     {
26
-        $now = Carbon::now();
26
+        $now = Carbon::now ();
27 27
 
28 28
         // Find published jobs that are currently open for applications.
29 29
         // Eager load required relationships: Department, Province, JobTerm.
30 30
         // Eager load the count of submitted applications, to prevent the relationship
31 31
         // from being actually loaded and firing off events.
32
-        $jobs = JobPoster::where('open_date_time', '<=', $now)
33
-            ->where('close_date_time', '>=', $now)
34
-            ->where('published', true)
35
-            ->with([
32
+        $jobs = JobPoster::where ('open_date_time', '<=', $now)
33
+            ->where ('close_date_time', '>=', $now)
34
+            ->where ('published', true)
35
+            ->with ([
36 36
                 'department',
37 37
                 'province',
38 38
                 'job_term',
39 39
             ])
40
-            ->withCount([
40
+            ->withCount ([
41 41
                 'submitted_applications',
42 42
             ])
43
-            ->get();
44
-        return view('applicant/job_index', [
45
-            'job_index' => Lang::get('applicant/job_index'),
43
+            ->get ();
44
+        return view ('applicant/job_index', [
45
+            'job_index' => Lang::get ('applicant/job_index'),
46 46
             'jobs' => $jobs
47 47
         ]);
48 48
     }
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function managerIndex()
56 56
     {
57
-        $manager = Auth::user()->manager;
57
+        $manager = Auth::user ()->manager;
58 58
 
59
-        $jobs = JobPoster::where('manager_id', $manager->id)
60
-            ->with('classification')
61
-            ->withCount('submitted_applications')
62
-            ->get();
59
+        $jobs = JobPoster::where ('manager_id', $manager->id)
60
+            ->with ('classification')
61
+            ->withCount ('submitted_applications')
62
+            ->get ();
63 63
 
64 64
         foreach ($jobs as &$job) {
65 65
             $chosen_lang = $job->chosen_lang;
66 66
 
67 67
             // Show chosen lang title if current title is empty.
68 68
             if (empty($job->title)) {
69
-                $job->title = $job->getTranslation('title', $chosen_lang);
69
+                $job->title = $job->getTranslation ('title', $chosen_lang);
70 70
                 $job->trans_required = true;
71 71
             }
72 72
 
73 73
             // Always preview and edit in the chosen language.
74
-            $job->preview_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.show', $job));
75
-            $job->edit_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.edit', $job));
74
+            $job->preview_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.show', $job));
75
+            $job->edit_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.edit', $job));
76 76
         }
77 77
 
78 78
 
79
-        return view('manager/job_index', [
79
+        return view ('manager/job_index', [
80 80
             // Localization Strings.
81
-            'jobs_l10n' => Lang::get('manager/job_index'),
81
+            'jobs_l10n' => Lang::get ('manager/job_index'),
82 82
             // Data.
83 83
             'jobs' => $jobs,
84 84
         ]);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function destroy(Request $request, JobPoster $jobPoster)
95 95
     {
96
-        $jobPoster->delete();
96
+        $jobPoster->delete ();
97 97
     }
98 98
 
99 99
     /**
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function show(Request $request, JobPoster $jobPoster)
107 107
     {
108
-        $jobPoster->load([
108
+        $jobPoster->load ([
109 109
             'department',
110 110
             'criteria.skill.skill_type',
111 111
             'manager.team_culture',
112 112
             'manager.work_environment'
113 113
         ]);
114 114
 
115
-        $user = Auth::user();
115
+        $user = Auth::user ();
116 116
 
117 117
         // TODO: Improve workplace photos, and reference them in template direction from WorkEnvironment model.
118 118
         $workplacePhotos = [];
@@ -125,36 +125,36 @@  discard block
 block discarded – undo
125 125
 
126 126
         // TODO: replace route('manager.show',manager.id) in templates with link using slug.
127 127
         $criteria = [
128
-            'essential' => $jobPoster->criteria->filter(
129
-                function ($value, $key) {
128
+            'essential' => $jobPoster->criteria->filter (
129
+                function ($value, $key){
130 130
                     return $value->criteria_type->name == 'essential';
131 131
                 }
132 132
             ),
133
-            'asset' => $jobPoster->criteria->filter(
134
-                function ($value, $key) {
133
+            'asset' => $jobPoster->criteria->filter (
134
+                function ($value, $key){
135 135
                     return $value->criteria_type->name == 'asset';
136 136
                 }
137 137
             ),
138 138
         ];
139 139
 
140
-        $jobLang = Lang::get('applicant/job_post');
140
+        $jobLang = Lang::get ('applicant/job_post');
141 141
 
142 142
         $applyButton = [];
143
-        if (!$jobPoster->published && $this->authorize('update', $jobPoster)) {
143
+        if (!$jobPoster->published && $this->authorize ('update', $jobPoster)) {
144 144
             $applyButton = [
145
-                'href' => route('manager.jobs.edit', $jobPoster->id),
145
+                'href' => route ('manager.jobs.edit', $jobPoster->id),
146 146
                 'title' => $jobLang['apply']['edit_link_title'],
147 147
                 'text' => $jobLang['apply']['edit_link_label'],
148 148
             ];
149
-        } elseif (Auth::check() && $jobPoster->isOpen()) {
149
+        } elseif (Auth::check () && $jobPoster->isOpen ()) {
150 150
             $applyButton = [
151
-                'href' => route('job.application.edit.1', $jobPoster->id),
151
+                'href' => route ('job.application.edit.1', $jobPoster->id),
152 152
                 'title' => $jobLang['apply']['apply_link_title'],
153 153
                 'text' => $jobLang['apply']['apply_link_label'],
154 154
             ];
155
-        } elseif (Auth::guest() && $jobPoster->isOpen()) {
155
+        } elseif (Auth::guest () && $jobPoster->isOpen ()) {
156 156
             $applyButton = [
157
-                'href' => route('job.application.edit.1', $jobPoster->id),
157
+                'href' => route ('job.application.edit.1', $jobPoster->id),
158 158
                 'title' => $jobLang['apply']['login_link_title'],
159 159
                 'text' => $jobLang['apply']['login_link_label'],
160 160
             ];
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
             ];
167 167
         }
168 168
 
169
-        $jpb_release_date = strtotime('2019-08-21 16:18:17');
170
-        $job_created_at = strtotime($jobPoster->created_at);
169
+        $jpb_release_date = strtotime ('2019-08-21 16:18:17');
170
+        $job_created_at = strtotime ($jobPoster->created_at);
171 171
 
172 172
         // If the job poster is created after the release of the JPB.
173 173
         // Then, render with updated poster template.
174 174
         // Else, render with old poster template.
175 175
         if ($job_created_at > $jpb_release_date) {
176 176
             // Updated job poster (JPB).
177
-            return view(
177
+            return view (
178 178
                 'applicant/jpb_job_post',
179 179
                 [
180 180
                     'job_post' => $jobLang,
181
-                    'skill_template' => Lang::get('common/skills'),
181
+                    'skill_template' => Lang::get ('common/skills'),
182 182
                     'job' => $jobPoster,
183 183
                     'manager' => $jobPoster->manager,
184 184
                     'criteria' => $criteria,
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             );
188 188
         } else {
189 189
             // Old job poster.
190
-            return view(
190
+            return view (
191 191
                 'applicant/job_post',
192 192
                 [
193 193
                     'job_post' => $jobLang,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                     'job' => $jobPoster,
200 200
                     'criteria' => $criteria,
201 201
                     'apply_button' => $applyButton,
202
-                    'skill_template' => Lang::get('common/skills'),
202
+                    'skill_template' => Lang::get ('common/skills'),
203 203
                 ]
204 204
             );
205 205
         }
@@ -217,20 +217,20 @@  discard block
 block discarded – undo
217 217
     {
218 218
         $manager = $jobPoster->manager;
219 219
 
220
-        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count() === 0) {
221
-            $jobPoster->job_poster_questions()->saveMany($this->populateDefaultQuestions());
222
-            $jobPoster->refresh();
220
+        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count () === 0) {
221
+            $jobPoster->job_poster_questions ()->saveMany ($this->populateDefaultQuestions ());
222
+            $jobPoster->refresh ();
223 223
         }
224 224
 
225
-        return view(
225
+        return view (
226 226
             'manager/job_create',
227 227
             [
228 228
                 // Localization Strings.
229
-                'job_l10n' => Lang::get('manager/job_edit'),
229
+                'job_l10n' => Lang::get ('manager/job_edit'),
230 230
                 // Data.
231 231
                 'manager' => $manager,
232 232
                 'job' => $jobPoster,
233
-                'form_action_url' => route('admin.jobs.update', $jobPoster),
233
+                'form_action_url' => route ('admin.jobs.update', $jobPoster),
234 234
             ]
235 235
         );
236 236
     }
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function createAsManager(Manager $manager)
245 245
     {
246
-        $jobPoster = new JobPoster();
246
+        $jobPoster = new JobPoster ();
247 247
         $jobPoster->manager_id = $manager->id;
248 248
 
249 249
         // Save manager-specific info to the job poster - equivalent to the intro step of the JPB
250
-        $divisionEn = $manager->getTranslation('division', 'en');
251
-        $divisionFr = $manager->getTranslation('division', 'fr');
252
-        $jobPoster->fill([
250
+        $divisionEn = $manager->getTranslation ('division', 'en');
251
+        $divisionFr = $manager->getTranslation ('division', 'fr');
252
+        $jobPoster->fill ([
253 253
             'department_id' => $manager->department_id,
254 254
             'division' => ['en' => $divisionEn],
255 255
             'division' => ['fr' => $divisionFr],
256 256
         ]);
257 257
 
258
-        $jobPoster->save();
258
+        $jobPoster->save ();
259 259
 
260
-        return redirect()->route('manager.jobs.edit', $jobPoster->id);
260
+        return redirect ()->route ('manager.jobs.edit', $jobPoster->id);
261 261
     }
262 262
 
263 263
     /**
@@ -272,19 +272,19 @@  discard block
 block discarded – undo
272 272
     {
273 273
         // Don't allow edits for published Job Posters
274 274
         // Also check auth while we're at it.
275
-        $this->authorize('update', $jobPoster);
276
-        JobPosterValidator::validateUnpublished($jobPoster);
275
+        $this->authorize ('update', $jobPoster);
276
+        JobPosterValidator::validateUnpublished ($jobPoster);
277 277
 
278
-        $input = $request->input();
278
+        $input = $request->input ();
279 279
 
280 280
         if ($jobPoster->manager_id == null) {
281
-            $jobPoster->manager_id = $request->user()->manager->id;
282
-            $jobPoster->save();
281
+            $jobPoster->manager_id = $request->user ()->manager->id;
282
+            $jobPoster->save ();
283 283
         }
284 284
 
285
-        $this->fillAndSaveJobPosterQuestions($input, $jobPoster, true);
285
+        $this->fillAndSaveJobPosterQuestions ($input, $jobPoster, true);
286 286
 
287
-        return redirect(route('manager.jobs.show', $jobPoster->id));
287
+        return redirect (route ('manager.jobs.show', $jobPoster->id));
288 288
     }
289 289
 
290 290
     /**
@@ -298,17 +298,17 @@  discard block
 block discarded – undo
298 298
     protected function fillAndSaveJobPosterQuestions(array $input, JobPoster $jobPoster, bool $replace) : void
299 299
     {
300 300
         if ($replace) {
301
-            $jobPoster->job_poster_questions()->delete();
301
+            $jobPoster->job_poster_questions ()->delete ();
302 302
         }
303 303
 
304
-        if (!array_key_exists('question', $input) || !is_array($input['question'])) {
304
+        if (!array_key_exists ('question', $input) || !is_array ($input['question'])) {
305 305
             return;
306 306
         }
307 307
 
308 308
         foreach ($input['question'] as $question) {
309
-            $jobQuestion = new JobPosterQuestion();
309
+            $jobQuestion = new JobPosterQuestion ();
310 310
             $jobQuestion->job_poster_id = $jobPoster->id;
311
-            $jobQuestion->fill(
311
+            $jobQuestion->fill (
312 312
                 [
313 313
                     'question' => [
314 314
                         'en' => $question['question']['en'],
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
                     ]
322 322
                 ]
323 323
             );
324
-            $jobPoster->save();
325
-            $jobQuestion->save();
324
+            $jobPoster->save ();
325
+            $jobQuestion->save ();
326 326
         }
327 327
     }
328 328
 
@@ -334,20 +334,20 @@  discard block
 block discarded – undo
334 334
     protected function populateDefaultQuestions()
335 335
     {
336 336
         $defaultQuestions = [
337
-            'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']),
338
-            'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']),
337
+            'en' => array_values (Lang::get ('manager/job_create', [], 'en')['questions']),
338
+            'fr' => array_values (Lang::get ('manager/job_create', [], 'fr')['questions']),
339 339
         ];
340 340
 
341
-        if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) {
342
-            Log::warning('There must be the same number of French and English default questions for a Job Poster.');
341
+        if (count ($defaultQuestions['en']) !== count ($defaultQuestions['fr'])) {
342
+            Log::warning ('There must be the same number of French and English default questions for a Job Poster.');
343 343
             return;
344 344
         }
345 345
 
346 346
         $jobQuestions = [];
347 347
 
348
-        for ($i = 0; $i < count($defaultQuestions['en']); $i++) {
349
-            $jobQuestion = new JobPosterQuestion();
350
-            $jobQuestion->fill(
348
+        for ($i = 0; $i < count ($defaultQuestions['en']); $i++) {
349
+            $jobQuestion = new JobPosterQuestion ();
350
+            $jobQuestion->fill (
351 351
                 [
352 352
                     'question' => [
353 353
                         'en' => $defaultQuestions['en'][$i],
Please login to merge, or discard this patch.
app/Http/Resources/Manager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
      */
15 15
     public function toArray($request)
16 16
     {
17
-        return parent::toArray($request);
17
+        return parent::toArray ($request);
18 18
     }
19 19
 }
Please login to merge, or discard this patch.