@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public static function getOtherApplications(Candidate $candidate) |
12 | 12 | { |
13 | 13 | return Candidate::where('id', '!=', $candidate->id) |
14 | - ->where(function ($query) use ($candidate) { |
|
14 | + ->where(function($query) use ($candidate) { |
|
15 | 15 | $query->where('email', '=', $candidate->email) |
16 | 16 | ->orWhere('email', '=', sha1($candidate->email)) |
17 | 17 | ->orWhere('phone_number', '=', $candidate->phone_number) |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | return Candidate::query() |
27 | 27 | ->get(['name']) |
28 | - ->map(function ($candidate) { |
|
28 | + ->map(function($candidate) { |
|
29 | 29 | return trim( |
30 | 30 | join(' ', [ |
31 | 31 | htmlspecialchars(data_get($candidate, 'name')), |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | |
48 | 48 | if (count($array) === 2) { |
49 | 49 | $query = $query |
50 | - ->where('name', 'like', '%'.$array[0].'%'); |
|
50 | + ->where('name', 'like', '%' . $array[0] . '%'); |
|
51 | 51 | } else { |
52 | 52 | $query = $query |
53 | - ->where(function (Builder $query) use ($array) { |
|
53 | + ->where(function(Builder $query) use ($array) { |
|
54 | 54 | $query |
55 | - ->where(function (Builder $query) use ($array) { |
|
55 | + ->where(function(Builder $query) use ($array) { |
|
56 | 56 | foreach ($array as $item) { |
57 | 57 | $query->orWhere('name', 'like', "%{$item}%"); |
58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | if (!$user->can('read all recruitments')) { |
63 | 63 | $filtered = $candidates->filter( |
64 | - function ($candidate, $key) use ($user) { |
|
64 | + function($candidate, $key) use ($user) { |
|
65 | 65 | return $user->can('view', $candidate); |
66 | 66 | } |
67 | 67 | ); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $candidate = CandidateUpdater::updateCandidate($candidate->id, $request); |
97 | 97 | |
98 | - return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]); |
|
98 | + return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | public function delete(CandidateDeleteRequest $request, Candidate $candidate) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $candidate->save(); |
113 | 113 | } |
114 | 114 | |
115 | - return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]); |
|
115 | + return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | //TODO: route nie chroniony - docelowo zrobić zabezpieczenie z użyciem jednorazowych tokenów, a także nie przekazywać do klienta pola path_to_cv |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return response('File not found', 404); |
126 | 126 | } |
127 | 127 | |
128 | - $fileName = str_replace(' ', '_', $candidate->name).'-CV.pdf'; //TODO sanitize |
|
128 | + $fileName = str_replace(' ', '_', $candidate->name) . '-CV.pdf'; //TODO sanitize |
|
129 | 129 | |
130 | 130 | if ($download) { |
131 | 131 | return Storage::disk('s3')->download($candidate->path_to_cv, $fileName); |
@@ -138,6 +138,6 @@ discard block |
||
138 | 138 | { |
139 | 139 | $candidate = StageChanger::changeStage($request); |
140 | 140 | |
141 | - return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]); |
|
141 | + return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]); |
|
142 | 142 | } |
143 | 143 | } |
@@ -24,6 +24,6 @@ |
||
24 | 24 | |
25 | 25 | $note = Note::with('user')->find($note->id); |
26 | 26 | |
27 | - return response()->json($note, 201, ['Location'=>'/notes/'.$note->id]); |
|
27 | + return response()->json($note, 201, ['Location'=>'/notes/' . $note->id]); |
|
28 | 28 | } |
29 | 29 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function handle($request, Closure $next) |
21 | 21 | { |
22 | 22 | if ($request->has('access_token')) { |
23 | - $request->headers->set('Authorization', 'Bearer '.$request->get('access_token')); |
|
23 | + $request->headers->set('Authorization', 'Bearer ' . $request->get('access_token')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return $next($request); |
@@ -27,8 +27,8 @@ |
||
27 | 27 | public function toArray($request) |
28 | 28 | { |
29 | 29 | $array = parent::toArray($request); |
30 | - $array['url'] = config('app.apply_url').'/'.static::$tenantManager->getTenant()->subdomain.'/'.$array['key'] |
|
31 | - .'-'.preg_replace("/[^A-Za-z0-9\-]/", '', str_replace(' ', '-', $this->recruitment->job_title)); |
|
30 | + $array['url'] = config('app.apply_url') . '/' . static::$tenantManager->getTenant()->subdomain . '/' . $array['key'] |
|
31 | + .'-' . preg_replace("/[^A-Za-z0-9\-]/", '', str_replace(' ', '-', $this->recruitment->job_title)); |
|
32 | 32 | |
33 | 33 | return $array; |
34 | 34 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | 'name' => $this->name, |
27 | 27 | 'email' => $this->email, |
28 | 28 | 'phone_number' => PhoneFormatter::format($this->phone_number), |
29 | - 'photo_path' => $this->photo_path ? env('AVATARS_URL').'/'.$this->photo_path : null, |
|
29 | + 'photo_path' => $this->photo_path ? env('AVATARS_URL') . '/' . $this->photo_path : null, |
|
30 | 30 | 'recruitment_id' => $this->recruitment_id, |
31 | 31 | 'stage_id' => $this->stage_id, |
32 | 32 | 'seen_at' => $this->seen_at, |
@@ -51,8 +51,8 @@ |
||
51 | 51 | unset($array['sources'][$key]['url_path']); |
52 | 52 | |
53 | 53 | //TODO: zduplikowany kod z SourceResource |
54 | - $array['sources'][$key]['url'] = config('app.apply_url').'/'.static::$tenantManager->getTenant()->subdomain.'/'.$source['key'] |
|
55 | - .'-'.preg_replace("/[^A-Za-z0-9\-]/", '', str_replace(' ', '-', $array['job_title'])); |
|
54 | + $array['sources'][$key]['url'] = config('app.apply_url') . '/' . static::$tenantManager->getTenant()->subdomain . '/' . $source['key'] |
|
55 | + .'-' . preg_replace("/[^A-Za-z0-9\-]/", '', str_replace(' ', '-', $array['job_title'])); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return $array; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | 'user_id' => [ |
29 | 29 | 'required', |
30 | 30 | 'exists:tenant.users,id', |
31 | - Rule::unique('tenant.recruitment_user')->where(function ($query) { |
|
31 | + Rule::unique('tenant.recruitment_user')->where(function($query) { |
|
32 | 32 | return $query->where('recruitment_id', $this->recruitment->id); |
33 | 33 | }), |
34 | 34 | ], |
@@ -32,7 +32,7 @@ |
||
32 | 32 | if ($tenantId) { |
33 | 33 | $tenant = Tenant::find($tenantId); |
34 | 34 | if (!$tenant) { |
35 | - throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.'); |
|
35 | + throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $this->tenantManager->setTenant($tenant); |