@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function editAuthenticated(Request $request) |
21 | 21 | { |
22 | - $applicant = $request->user()->applicant; |
|
23 | - return redirect(route('profile.work_samples.edit', $applicant)); |
|
22 | + $applicant = $request->user ()->applicant; |
|
23 | + return redirect (route ('profile.work_samples.edit', $applicant)); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function edit(Request $request, Applicant $applicant) |
34 | 34 | { |
35 | - $applicant->load([ |
|
35 | + $applicant->load ([ |
|
36 | 36 | 'work_samples', |
37 | 37 | 'skill_declarations.skill', |
38 | 38 | ]); |
39 | 39 | |
40 | - return view('applicant/profile_05_portfolio', [ |
|
40 | + return view ('applicant/profile_05_portfolio', [ |
|
41 | 41 | 'applicant' => $applicant, |
42 | - 'profile' => Lang::get('applicant/profile_work_samples'), |
|
42 | + 'profile' => Lang::get ('applicant/profile_work_samples'), |
|
43 | 43 | ]); |
44 | 44 | } |
45 | 45 | |
@@ -52,31 +52,31 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function update(Request $request, ?WorkSample $workSample = null) |
54 | 54 | { |
55 | - $validator = new UpdateWorkSampleValidator(); |
|
56 | - $validator->validate($request->input()); |
|
55 | + $validator = new UpdateWorkSampleValidator (); |
|
56 | + $validator->validate ($request->input ()); |
|
57 | 57 | |
58 | 58 | if ($workSample === null) { |
59 | - $workSample = new WorkSample(); |
|
60 | - $workSample->applicant_id = $request->user()->applicant->id; |
|
59 | + $workSample = new WorkSample (); |
|
60 | + $workSample->applicant_id = $request->user ()->applicant->id; |
|
61 | 61 | } |
62 | - $workSample->fill([ |
|
63 | - 'name' => $request->input('name'), |
|
64 | - 'file_type_id' => $request->input('file_type_id'), |
|
65 | - 'url' => $request->input('url'), |
|
66 | - 'description' => $request->input('description'), |
|
62 | + $workSample->fill ([ |
|
63 | + 'name' => $request->input ('name'), |
|
64 | + 'file_type_id' => $request->input ('file_type_id'), |
|
65 | + 'url' => $request->input ('url'), |
|
66 | + 'description' => $request->input ('description'), |
|
67 | 67 | ]); |
68 | - $workSample->save(); |
|
68 | + $workSample->save (); |
|
69 | 69 | |
70 | 70 | // Attach relatives. |
71 | - $skillIds = $this->getRelativeIds($request->input(), 'skills'); |
|
72 | - $workSample->skill_declarations()->sync($skillIds); |
|
71 | + $skillIds = $this->getRelativeIds ($request->input (), 'skills'); |
|
72 | + $workSample->skill_declarations ()->sync ($skillIds); |
|
73 | 73 | |
74 | 74 | // If an ajax request, return the new object. |
75 | - if ($request->ajax()) { |
|
76 | - $workSample->load('file_type'); |
|
77 | - return $workSample->toJson(); |
|
75 | + if ($request->ajax ()) { |
|
76 | + $workSample->load ('file_type'); |
|
77 | + return $workSample->toJson (); |
|
78 | 78 | } else { |
79 | - return redirect()->back(); |
|
79 | + return redirect ()->back (); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function destroy(Request $request, WorkSample $workSample) |
91 | 91 | { |
92 | - $this->authorize('delete', $workSample); |
|
92 | + $this->authorize ('delete', $workSample); |
|
93 | 93 | |
94 | - $workSample->delete(); |
|
94 | + $workSample->delete (); |
|
95 | 95 | |
96 | - if ($request->ajax()) { |
|
96 | + if ($request->ajax ()) { |
|
97 | 97 | return [ |
98 | 98 | 'message' => 'Work sample deleted' |
99 | 99 | ]; |
100 | 100 | } |
101 | 101 | |
102 | - return redirect()->back(); |
|
102 | + return redirect ()->back (); |
|
103 | 103 | } |
104 | 104 | } |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | // ->hourly(); |
29 | 29 | |
30 | 30 | // start the queue daemon, if its not running |
31 | - if (!$this->osProcessIsRunning('queue:work')) { |
|
32 | - $schedule->command('queue:work')->everyMinute(); |
|
31 | + if (!$this->osProcessIsRunning ('queue:work')) { |
|
32 | + $schedule->command ('queue:work')->everyMinute (); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function commands(): void |
42 | 42 | { |
43 | - $this->load(__DIR__.'/Commands'); |
|
43 | + $this->load (__DIR__.'/Commands'); |
|
44 | 44 | |
45 | - require base_path('routes/console.php'); |
|
45 | + require base_path ('routes/console.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | protected function osProcessIsRunning(string $needle): bool |
55 | 55 | { |
56 | 56 | // get process status. the "-ww"-option is important to get the full output! |
57 | - exec('ps aux -ww', $process_status); |
|
57 | + exec ('ps aux -ww', $process_status); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | // search $needle in process status |
61 | - $result = array_filter( |
|
61 | + $result = array_filter ( |
|
62 | 62 | $process_status, |
63 | 63 | function ($var) use ($needle) { |
64 | - return strpos($var, $needle); |
|
64 | + return strpos ($var, $needle); |
|
65 | 65 | } |
66 | 66 | ); |
67 | 67 |
@@ -10,34 +10,34 @@ |
||
10 | 10 | |
11 | 11 | public function isApplicantPortal() |
12 | 12 | { |
13 | - return !$this->isManagerPortal() && !$this->isAdminPortal(); |
|
13 | + return !$this->isManagerPortal () && !$this->isAdminPortal (); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function isManagerPortal() |
17 | 17 | { |
18 | - $url = URL::current(); |
|
19 | - return $this->urlIsManagerPortal($url); |
|
18 | + $url = URL::current (); |
|
19 | + return $this->urlIsManagerPortal ($url); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function isAdminPortal() |
23 | 23 | { |
24 | - $url = URL::current(); |
|
25 | - return $this->urlIsAdminPortal($url); |
|
24 | + $url = URL::current (); |
|
25 | + return $this->urlIsAdminPortal ($url); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function urlIsManagerPortal($url): bool |
29 | 29 | { |
30 | - $baseUrl = config('app.url'); |
|
31 | - $managerPrefix = config('app.manager_prefix'); |
|
30 | + $baseUrl = config ('app.url'); |
|
31 | + $managerPrefix = config ('app.manager_prefix'); |
|
32 | 32 | $managerPattern = "#^$baseUrl/(\w+/)?$managerPrefix(/.*)?$#"; |
33 | - return preg_match($managerPattern, $url); |
|
33 | + return preg_match ($managerPattern, $url); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function urlIsAdminPortal($url): bool |
37 | 37 | { |
38 | - $baseUrl = config('app.url'); |
|
39 | - $adminPrefix = config('backpack.base.route_prefix', 'admin'); |
|
38 | + $baseUrl = config ('app.url'); |
|
39 | + $adminPrefix = config ('backpack.base.route_prefix', 'admin'); |
|
40 | 40 | $adminPattern = "#^$baseUrl/(\w+/)?$adminPrefix(/.*)?$#"; |
41 | - return preg_match($adminPattern, $url); |
|
41 | + return preg_match ($adminPattern, $url); |
|
42 | 42 | } |
43 | 43 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public static function userValidator(array $data) |
40 | 40 | { |
41 | - return Validator::make($data, self::basicRules()); |
|
41 | + return Validator::make ($data, self::basicRules ()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function managerValidator(array $data) |
51 | 51 | { |
52 | - $managerRules = array_merge(self::basicRules(), self::managerRegistrationExtraRules()); |
|
53 | - return Validator::make($data, $managerRules); |
|
52 | + $managerRules = array_merge (self::basicRules (), self::managerRegistrationExtraRules ()); |
|
53 | + return Validator::make ($data, $managerRules); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -61,6 +61,6 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public static function finalizeManagerValidator(array $data) |
63 | 63 | { |
64 | - return Validator::make($data, self::managerRegistrationExtraRules()); |
|
64 | + return Validator::make ($data, self::managerRegistrationExtraRules ()); |
|
65 | 65 | } |
66 | 66 | } |
@@ -11,11 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | public function passes($attribute, $value) |
13 | 13 | { |
14 | - return Hash::check($value, Auth::user()->getAuthPassword()); |
|
14 | + return Hash::check ($value, Auth::user ()->getAuthPassword ()); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function message() |
18 | 18 | { |
19 | - return Lang::get('validation.password_correct'); |
|
19 | + return Lang::get ('validation.password_correct'); |
|
20 | 20 | } |
21 | 21 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function passes($attribute, $value) |
35 | 35 | { |
36 | 36 | $model = $this->className; |
37 | - return $model::where('id', $value)->exists(); |
|
37 | + return $model::where ('id', $value)->exists (); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -44,6 +44,6 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function message() |
46 | 46 | { |
47 | - return Lang::get('validation.invalid_id'); |
|
47 | + return Lang::get ('validation.invalid_id'); |
|
48 | 48 | } |
49 | 49 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function passes($attribute, $value) |
25 | 25 | { |
26 | - return preg_match('/' . self::PATTERN . '/', $value); |
|
26 | + return preg_match ('/'.self::PATTERN.'/', $value); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -33,6 +33,6 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function message() |
35 | 35 | { |
36 | - return Lang::get('validation.custom.linkedin_url'); |
|
36 | + return Lang::get ('validation.custom.linkedin_url'); |
|
37 | 37 | } |
38 | 38 | } |
@@ -13,26 +13,26 @@ |
||
13 | 13 | public function __construct(Applicant $applicant) |
14 | 14 | { |
15 | 15 | $this->applicant = $applicant; |
16 | - $this->file_type_id = FileType::all()->pluck('id'); |
|
16 | + $this->file_type_id = FileType::all ()->pluck ('id'); |
|
17 | 17 | |
18 | 18 | } |
19 | 19 | public function validate(WorkSamplesValidatorValidator $workSamplesValidator) |
20 | 20 | { |
21 | - $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $workSamplesValidator->id); |
|
21 | + $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $workSamplesValidator->id); |
|
22 | 22 | //This array is reset every time because applicants table can change frequently |
23 | - $applicant_ids = Applicant::all()->pluck('id'); |
|
23 | + $applicant_ids = Applicant::all ()->pluck ('id'); |
|
24 | 24 | //Validate basic data is filled in |
25 | - Validator::make($workSamplesValidator->getAttributes(), [ |
|
25 | + Validator::make ($workSamplesValidator->getAttributes (), [ |
|
26 | 26 | 'applicant_id' => [ |
27 | 27 | 'required', |
28 | - Rule::in($applicant_ids->toArray()), |
|
28 | + Rule::in ($applicant_ids->toArray ()), |
|
29 | 29 | ], |
30 | 30 | 'file_type_id' => [ |
31 | 31 | 'required', |
32 | - Rule::in($this->file_type_id->toArray()), |
|
32 | + Rule::in ($this->file_type_id->toArray ()), |
|
33 | 33 | ] |
34 | 34 | |
35 | - ])->validate(); |
|
35 | + ])->validate (); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -32,12 +32,12 @@ |
||
32 | 32 | */ |
33 | 33 | public function passes($attribute, $value) |
34 | 34 | { |
35 | - return $this->applicant->getRelationValue($this->relation) |
|
36 | - ->pluck('id')->contains($value); |
|
35 | + return $this->applicant->getRelationValue ($this->relation) |
|
36 | + ->pluck ('id')->contains ($value); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function message() |
40 | 40 | { |
41 | - return Lang::get('validation.applicant_has_relation'); |
|
41 | + return Lang::get ('validation.applicant_has_relation'); |
|
42 | 42 | } |
43 | 43 | } |