@@ -56,6 +56,6 @@ |
||
56 | 56 | */ |
57 | 57 | public function build() |
58 | 58 | { |
59 | - return $this->text('emails.job_posters.review_requested_plain'); |
|
59 | + return $this->text ('emails.job_posters.review_requested_plain'); |
|
60 | 60 | } |
61 | 61 | } |
@@ -12,6 +12,6 @@ |
||
12 | 12 | */ |
13 | 13 | public function run() |
14 | 14 | { |
15 | - factory(JobPoster::class, 5)->create(); |
|
15 | + factory (JobPoster::class, 5)->create (); |
|
16 | 16 | } |
17 | 17 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function run() |
13 | 13 | { |
14 | - $this->call([ |
|
14 | + $this->call ([ |
|
15 | 15 | DevSeeder::class, |
16 | 16 | SkillClassificationSeeder::class |
17 | 17 | ]); |
@@ -14,8 +14,8 @@ |
||
14 | 14 | */ |
15 | 15 | public function run() |
16 | 16 | { |
17 | - factory(Manager::class, 10)->create(); |
|
18 | - factory(Applicant::class, 5)->create(); |
|
17 | + factory (Manager::class, 10)->create (); |
|
18 | + factory (Applicant::class, 5)->create (); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | } |
@@ -44,86 +44,86 @@ |
||
44 | 44 | */ |
45 | 45 | public function run() : void |
46 | 46 | { |
47 | - $adminUser = User::where('email', $this->adminEmail)->first(); |
|
47 | + $adminUser = User::where ('email', $this->adminEmail)->first (); |
|
48 | 48 | if ($adminUser === null) { |
49 | - $adminUser = factory(User::class)->state('admin')->create(['email' => $this->adminEmail]); |
|
49 | + $adminUser = factory (User::class)->state ('admin')->create (['email' => $this->adminEmail]); |
|
50 | 50 | } |
51 | 51 | |
52 | - $managerUser = User::where('email', $this->managerEmail)->first(); |
|
52 | + $managerUser = User::where ('email', $this->managerEmail)->first (); |
|
53 | 53 | // Create the test manager if it does not exist yet. |
54 | 54 | if ($managerUser === null) { |
55 | - $managerUser = factory(User::class)->state('upgradedManager')->create(['email' => $this->managerEmail]); |
|
56 | - $managerUser->manager()->save(factory(Manager::class)->create([ |
|
55 | + $managerUser = factory (User::class)->state ('upgradedManager')->create (['email' => $this->managerEmail]); |
|
56 | + $managerUser->manager ()->save (factory (Manager::class)->create ([ |
|
57 | 57 | 'user_id' => $managerUser->id |
58 | 58 | ])); |
59 | 59 | } |
60 | 60 | |
61 | - factory(JobPoster::class, 3)->state('published')->create([ |
|
61 | + factory (JobPoster::class, 3)->state ('published')->create ([ |
|
62 | 62 | 'manager_id' => $managerUser->manager->id |
63 | - ])->each(function ($job) : void { |
|
64 | - $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
|
63 | + ])->each (function ($job) : void { |
|
64 | + $job->job_applications ()->saveMany (factory (JobApplication::class, 5))->create ([ |
|
65 | 65 | 'job_poster_id' => $job->id |
66 | 66 | ]); |
67 | 67 | // Then create one application with a priority user. |
68 | - $job->job_applications()->save(factory(JobApplication::class)->create([ |
|
68 | + $job->job_applications ()->save (factory (JobApplication::class)->create ([ |
|
69 | 69 | 'job_poster_id' => $job->id, |
70 | - 'applicant_id' => factory(Applicant::class)->create([ |
|
71 | - 'user_id' => factory(User::class)->state('priority')->create()->id |
|
70 | + 'applicant_id' => factory (Applicant::class)->create ([ |
|
71 | + 'user_id' => factory (User::class)->state ('priority')->create ()->id |
|
72 | 72 | ])->id |
73 | 73 | ])); |
74 | 74 | }); |
75 | - factory(JobPoster::class, 3)->state('closed')->create([ |
|
75 | + factory (JobPoster::class, 3)->state ('closed')->create ([ |
|
76 | 76 | 'manager_id' => $managerUser->manager->id |
77 | - ])->each(function ($job) : void { |
|
78 | - $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
|
77 | + ])->each (function ($job) : void { |
|
78 | + $job->job_applications ()->saveMany (factory (JobApplication::class, 5))->create ([ |
|
79 | 79 | 'job_poster_id' => $job->id |
80 | 80 | ]); |
81 | 81 | // Then create one application with a priority user. |
82 | - $job->job_applications()->save(factory(JobApplication::class)->create([ |
|
82 | + $job->job_applications ()->save (factory (JobApplication::class)->create ([ |
|
83 | 83 | 'job_poster_id' => $job->id, |
84 | - 'applicant_id' => factory(Applicant::class)->create([ |
|
85 | - 'user_id' => factory(User::class)->state('priority')->create()->id |
|
84 | + 'applicant_id' => factory (Applicant::class)->create ([ |
|
85 | + 'user_id' => factory (User::class)->state ('priority')->create ()->id |
|
86 | 86 | ])->id |
87 | 87 | ])); |
88 | 88 | }); |
89 | - factory(JobPoster::class, 3)->state('draft')->create([ |
|
89 | + factory (JobPoster::class, 3)->state ('draft')->create ([ |
|
90 | 90 | 'manager_id' => $managerUser->manager->id |
91 | 91 | ]); |
92 | - factory(JobPoster::class, 3)->state('review_requested')->create([ |
|
92 | + factory (JobPoster::class, 3)->state ('review_requested')->create ([ |
|
93 | 93 | 'manager_id' => $managerUser->manager->id |
94 | 94 | ]); |
95 | 95 | |
96 | 96 | // Create a Job Poster with an Assessment Plan. |
97 | - $jobWithAssessment = factory(JobPoster::class)->state('draft')->create([ |
|
97 | + $jobWithAssessment = factory (JobPoster::class)->state ('draft')->create ([ |
|
98 | 98 | 'manager_id' => $managerUser->manager->id, |
99 | 99 | ]); |
100 | 100 | foreach ($jobWithAssessment->criteria as $criterion) { |
101 | 101 | // Create an assessment for each criterion. |
102 | - factory(Assessment::class)->state('withRatingGuide')->create([ |
|
102 | + factory (Assessment::class)->state ('withRatingGuide')->create ([ |
|
103 | 103 | 'criterion_id' => $criterion->id, |
104 | 104 | ]); |
105 | 105 | }; |
106 | 106 | |
107 | - $applicantUser = User::where('email', $this->applicantEmail)->first(); |
|
107 | + $applicantUser = User::where ('email', $this->applicantEmail)->first (); |
|
108 | 108 | if ($applicantUser === null) { |
109 | - $applicantUser = factory(User::class)->state('applicant')->create([ |
|
109 | + $applicantUser = factory (User::class)->state ('applicant')->create ([ |
|
110 | 110 | 'email' => $this->applicantEmail |
111 | 111 | ]); |
112 | - $applicantUser->applicant()->save(factory(Applicant::class)->create([ |
|
112 | + $applicantUser->applicant ()->save (factory (Applicant::class)->create ([ |
|
113 | 113 | 'user_id' => $applicantUser->id |
114 | 114 | ])); |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Add to application profile. |
118 | - $applicantUser->applicant->references()->saveMany(factory(Reference::class, 3)->create([ |
|
118 | + $applicantUser->applicant->references ()->saveMany (factory (Reference::class, 3)->create ([ |
|
119 | 119 | 'applicant_id' => $applicantUser->applicant->id |
120 | 120 | ])); |
121 | 121 | |
122 | 122 | // Create several applications for test user. |
123 | - $applicantUser->applicant->job_applications()->saveMany(factory(JobApplication::class, 3)->create([ |
|
123 | + $applicantUser->applicant->job_applications ()->saveMany (factory (JobApplication::class, 3)->create ([ |
|
124 | 124 | 'applicant_id' => $applicantUser->applicant->id, |
125 | 125 | ])); |
126 | - $applicantUser->applicant->job_applications()->saveMany(factory(JobApplication::class, 2)->state('draft')->create([ |
|
126 | + $applicantUser->applicant->job_applications ()->saveMany (factory (JobApplication::class, 2)->state ('draft')->create ([ |
|
127 | 127 | 'applicant_id' => $applicantUser->applicant->id, |
128 | 128 | ])); |
129 | 129 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function authorize() : bool |
15 | 15 | { |
16 | 16 | // Only allow updates if the user is a logged in Admin. |
17 | - return backpack_auth()->check(); |
|
17 | + return backpack_auth ()->check (); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -18,33 +18,33 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function store(Request $request) |
20 | 20 | { |
21 | - $this->authorize('create', Assessment::class); |
|
21 | + $this->authorize ('create', Assessment::class); |
|
22 | 22 | |
23 | 23 | try { |
24 | - $criterion_id = (int)$request->json('criterion_id'); |
|
25 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
26 | - $criteria = Criteria::findOrFail($criterion_id); |
|
27 | - AssessmentType::findOrFail($assessment_type_id); |
|
24 | + $criterion_id = (int)$request->json ('criterion_id'); |
|
25 | + $assessment_type_id = (int)$request->json ('assessment_type_id'); |
|
26 | + $criteria = Criteria::findOrFail ($criterion_id); |
|
27 | + AssessmentType::findOrFail ($assessment_type_id); |
|
28 | 28 | |
29 | - $assessment = new Assessment([ |
|
29 | + $assessment = new Assessment ([ |
|
30 | 30 | 'criterion_id' => $criterion_id, |
31 | 31 | 'assessment_type_id' => $assessment_type_id |
32 | 32 | ]); |
33 | 33 | // Check that this user is allowed to create an Assessment for this criterion. |
34 | - $this->authorize('update', $assessment); |
|
34 | + $this->authorize ('update', $assessment); |
|
35 | 35 | |
36 | - $assessment->save(); |
|
37 | - $assessment->refresh(); |
|
38 | - $assessment['criteria'] = $criteria->toArray(); |
|
36 | + $assessment->save (); |
|
37 | + $assessment->refresh (); |
|
38 | + $assessment['criteria'] = $criteria->toArray (); |
|
39 | 39 | } catch (\Exception $e) { |
40 | - return response()->json([ |
|
41 | - 'error' => $e->getMessage() |
|
40 | + return response ()->json ([ |
|
41 | + 'error' => $e->getMessage () |
|
42 | 42 | ], 400); |
43 | 43 | } |
44 | 44 | |
45 | 45 | return [ |
46 | 46 | 'success' => "Successfully created assessment $assessment->id", |
47 | - 'assessment' => $assessment->toArray() |
|
47 | + 'assessment' => $assessment->toArray () |
|
48 | 48 | ]; |
49 | 49 | } |
50 | 50 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function show(Assessment $assessment) |
58 | 58 | { |
59 | - $this->authorize('view', $assessment); |
|
60 | - $criteria = Criteria::find($assessment->id); |
|
61 | - $assessment['criteria'] = $criteria->toArray(); |
|
62 | - return $assessment->toArray(); |
|
59 | + $this->authorize ('view', $assessment); |
|
60 | + $criteria = Criteria::find ($assessment->id); |
|
61 | + $assessment['criteria'] = $criteria->toArray (); |
|
62 | + return $assessment->toArray (); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -71,26 +71,26 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function update(Request $request, Assessment $assessment) |
73 | 73 | { |
74 | - $this->authorize('update', $assessment); |
|
74 | + $this->authorize ('update', $assessment); |
|
75 | 75 | try { |
76 | - $criterion_id = (int)$request->json('criterion_id'); |
|
77 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
78 | - $criteria = Criteria::findOrFail($criterion_id); |
|
79 | - AssessmentType::findOrFail($assessment_type_id); |
|
76 | + $criterion_id = (int)$request->json ('criterion_id'); |
|
77 | + $assessment_type_id = (int)$request->json ('assessment_type_id'); |
|
78 | + $criteria = Criteria::findOrFail ($criterion_id); |
|
79 | + AssessmentType::findOrFail ($assessment_type_id); |
|
80 | 80 | |
81 | 81 | $assessment->criterion_id = $criterion_id; |
82 | 82 | $assessment->assessment_type_id = $assessment_type_id; |
83 | - $assessment->save(); |
|
84 | - $assessment['criteria'] = $criteria->toArray(); |
|
83 | + $assessment->save (); |
|
84 | + $assessment['criteria'] = $criteria->toArray (); |
|
85 | 85 | } catch (\Exception $e) { |
86 | - return response()->json([ |
|
87 | - 'error' => $e->getMessage() |
|
86 | + return response ()->json ([ |
|
87 | + 'error' => $e->getMessage () |
|
88 | 88 | ], 400); |
89 | 89 | } |
90 | 90 | |
91 | 91 | return [ |
92 | 92 | 'success' => "Successfully updated assessment $assessment->id", |
93 | - 'assessment' => $assessment->toArray(), |
|
93 | + 'assessment' => $assessment->toArray (), |
|
94 | 94 | ]; |
95 | 95 | } |
96 | 96 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function destroy(Assessment $assessment) |
104 | 104 | { |
105 | - $this->authorize('delete', $assessment); |
|
106 | - $assessment->delete(); |
|
105 | + $this->authorize ('delete', $assessment); |
|
106 | + $assessment->delete (); |
|
107 | 107 | |
108 | 108 | return [ |
109 | 109 | 'success' => "Successfully deleted assessment $assessment->id" |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function index() |
21 | 21 | { |
22 | - $applications = Auth::user()->applicant->job_applications; |
|
23 | - return view( |
|
22 | + $applications = Auth::user ()->applicant->job_applications; |
|
23 | + return view ( |
|
24 | 24 | 'applicant/application_index', |
25 | 25 | [ |
26 | - 'application_index' => Lang::get('applicant/application_index'), |
|
26 | + 'application_index' => Lang::get ('applicant/application_index'), |
|
27 | 27 | 'applications' => $applications, |
28 | - 'departments_template' => Lang::get('common/lookup/departments'), |
|
28 | + 'departments_template' => Lang::get ('common/lookup/departments'), |
|
29 | 29 | 'manager_profile_photo' => '/images/user.png', // TODO: get real photo. |
30 | 30 | ] |
31 | 31 | ); |
@@ -40,48 +40,47 @@ discard block |
||
40 | 40 | public function show(JobApplication $application) |
41 | 41 | { |
42 | 42 | $criteria = [ |
43 | - 'essential' => $application->job_poster->criteria->filter(function ($value, $key) { |
|
43 | + 'essential' => $application->job_poster->criteria->filter (function ($value, $key){ |
|
44 | 44 | return $value->criteria_type->name == 'essential'; |
45 | 45 | }), |
46 | - 'asset' => $application->job_poster->criteria->filter(function ($value, $key) { |
|
46 | + 'asset' => $application->job_poster->criteria->filter (function ($value, $key){ |
|
47 | 47 | return $value->criteria_type->name == 'asset'; |
48 | 48 | }), |
49 | 49 | ]; |
50 | 50 | |
51 | 51 | // Display slightly different views on different portals. |
52 | - $view = WhichPortal::isManagerPortal() ? |
|
53 | - 'manager/application_post' : |
|
54 | - 'applicant/application_preview'; |
|
52 | + $view = WhichPortal::isManagerPortal () ? |
|
53 | + 'manager/application_post' : 'applicant/application_preview'; |
|
55 | 54 | |
56 | - if (WhichPortal::isManagerPortal()) { |
|
55 | + if (WhichPortal::isManagerPortal ()) { |
|
57 | 56 | // Load things required for review component. |
58 | - $application->load(['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']); |
|
57 | + $application->load (['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']); |
|
59 | 58 | } |
60 | 59 | |
61 | - return view( |
|
60 | + return view ( |
|
62 | 61 | $view, |
63 | 62 | [ |
64 | 63 | // Localized strings. |
65 | - 'post' => Lang::get('manager/application_post'), // Change text |
|
66 | - 'is_manager_view' => WhichPortal::isManagerPortal(), |
|
64 | + 'post' => Lang::get ('manager/application_post'), // Change text |
|
65 | + 'is_manager_view' => WhichPortal::isManagerPortal (), |
|
67 | 66 | // Application Template Data. |
68 | - 'application_template' => Lang::get('applicant/application_template'), |
|
67 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
69 | 68 | 'application_preview' => true, |
70 | - 'preferred_language_template' => Lang::get('common/preferred_language'), |
|
71 | - 'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'), |
|
72 | - 'veteran_status_template' => Lang::get('common/veteran_status'), |
|
69 | + 'preferred_language_template' => Lang::get ('common/preferred_language'), |
|
70 | + 'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'), |
|
71 | + 'veteran_status_template' => Lang::get ('common/veteran_status'), |
|
73 | 72 | // Job Data. |
74 | 73 | 'job' => $application->job_poster, |
75 | 74 | // Skills Data. |
76 | - 'skills' => Skill::all(), |
|
77 | - 'skill_template' => Lang::get('common/skills'), |
|
78 | - 'reference_template' => Lang::get('common/references'), |
|
79 | - 'sample_template' => Lang::get('common/work_samples'), |
|
75 | + 'skills' => Skill::all (), |
|
76 | + 'skill_template' => Lang::get ('common/skills'), |
|
77 | + 'reference_template' => Lang::get ('common/references'), |
|
78 | + 'sample_template' => Lang::get ('common/work_samples'), |
|
80 | 79 | 'criteria' => $criteria, |
81 | 80 | // Applicant Data. |
82 | 81 | 'applicant' => $application->applicant, |
83 | 82 | 'job_application' => $application, |
84 | - 'review_statuses' => ReviewStatus::all(), |
|
83 | + 'review_statuses' => ReviewStatus::all (), |
|
85 | 84 | ] |
86 | 85 | ); |
87 | 86 | } |
@@ -95,16 +94,16 @@ discard block |
||
95 | 94 | */ |
96 | 95 | public function destroy(Request $request, JobApplication $application) |
97 | 96 | { |
98 | - $this->authorize('delete', $application); |
|
97 | + $this->authorize ('delete', $application); |
|
99 | 98 | |
100 | - $application->delete(); |
|
99 | + $application->delete (); |
|
101 | 100 | |
102 | - if ($request->ajax()) { |
|
101 | + if ($request->ajax ()) { |
|
103 | 102 | return [ |
104 | 103 | 'message' => 'Application deleted' |
105 | 104 | ]; |
106 | 105 | } |
107 | 106 | |
108 | - return redirect()->back(); |
|
107 | + return redirect ()->back (); |
|
109 | 108 | } |
110 | 109 | } |
@@ -21,14 +21,14 @@ discard block |
||
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 |
||
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 |
||
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 | } |