@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | return static::getDefaultImage(); |
25 | 25 | } |
26 | 26 | |
27 | - return (object) [ |
|
28 | - '_50' => $server.'/storage/'.$folder.'/50-50/'.$imageName, |
|
29 | - '_100' => $server.'/storage/'.$folder.'/100-100/'.$imageName, |
|
30 | - 'original' => $server.'/storage/'.$folder.'/original/'.$imageName, |
|
27 | + return (object)[ |
|
28 | + '_50' => $server . '/storage/' . $folder . '/50-50/' . $imageName, |
|
29 | + '_100' => $server . '/storage/' . $folder . '/100-100/' . $imageName, |
|
30 | + 'original' => $server . '/storage/' . $folder . '/original/' . $imageName, |
|
31 | 31 | ]; |
32 | 32 | } |
33 | 33 | |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | $protocol = 'https://'; |
45 | 45 | } |
46 | 46 | |
47 | - return (object) [ |
|
48 | - '_50' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-50.png', |
|
49 | - '_100' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-100.png', |
|
50 | - 'original' => $protocol.$_SERVER['HTTP_HOST'].'/images/logo-original.png', |
|
47 | + return (object)[ |
|
48 | + '_50' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-50.png', |
|
49 | + '_100' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-100.png', |
|
50 | + 'original' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-original.png', |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public static function getImage(string $folder, ?Image $image, ?string $server = null) |
63 | 63 | { |
64 | - if (! $server) { |
|
64 | + if (!$server) { |
|
65 | 65 | $server = config('faithgen-sdk.ministries-server'); |
66 | 66 | } |
67 | 67 |
@@ -9,6 +9,6 @@ |
||
9 | 9 | { |
10 | 10 | public function creating(Activation $activation) |
11 | 11 | { |
12 | - $activation->code = (string) Str::uuid(); |
|
12 | + $activation->code = (string)Str::uuid(); |
|
13 | 13 | } |
14 | 14 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function creating(Ministry $ministry) |
16 | 16 | { |
17 | 17 | $ministry->password = Hash::make(request()->password); |
18 | - $ministry->id = (string) Str::uuid(); |
|
18 | + $ministry->id = (string)Str::uuid(); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | public function creating(User $user) |
24 | 24 | { |
25 | - $user->id = (string) Str::uuid(); |
|
25 | + $user->id = (string)Str::uuid(); |
|
26 | 26 | $user->password = Hash::make(env('DEFAULT_PASSWORD', 'secret')); |
27 | 27 | } |
28 | 28 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $results = parent::toArray($request); |
19 | 19 | $results = array_merge($results, [ |
20 | - 'active' => (bool) $this->activation->active, |
|
20 | + 'active' => (bool)$this->activation->active, |
|
21 | 21 | 'avatar' => ImageHelper::getImage('profile', $this->image), |
22 | 22 | ]); |
23 | 23 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | return [ |
14 | 14 | 'id' => $this->user_id, |
15 | - 'active' => (bool) $this->active, |
|
15 | + 'active' => (bool)$this->active, |
|
16 | 16 | 'name' => $this->user->name, |
17 | 17 | 'email' => $this->user->email, |
18 | 18 | 'phone' => $this->user->phone, |
@@ -22,7 +22,7 @@ |
||
22 | 22 | 'email' => $this->email, |
23 | 23 | 'phone' => $this->phone, |
24 | 24 | 'color' => $this->profile->color, |
25 | - 'active' => (bool) $this->activation->active, |
|
25 | + 'active' => (bool)$this->activation->active, |
|
26 | 26 | 'api_key' => $this->apiKey->api_key, |
27 | 27 | 'avatar' => ImageHelper::getImage('profile', $this->image, config('faithgen-sdk.ministries-server')), |
28 | 28 | 'date' => Helper::getDates($this->created_at), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $ministryUser = auth()->user() |
66 | 66 | ->ministryUsers() |
67 | - ->whereHas('user', fn ($user) => $user->where($request->validated())) |
|
67 | + ->whereHas('user', fn($user) => $user->where($request->validated())) |
|
68 | 68 | ->first(); |
69 | 69 | |
70 | 70 | if ($ministryUser) { |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | 'processing_image' => $request->has('image'), |
90 | 90 | ]; |
91 | 91 | |
92 | - if (! $request->has('image')) { |
|
92 | + if (!$request->has('image')) { |
|
93 | 93 | return $this->successResponse($messagePrefix, $data); |
94 | 94 | } else { |
95 | - return $this->successResponse($messagePrefix.' We are uploading your picture now', $data); |
|
95 | + return $this->successResponse($messagePrefix . ' We are uploading your picture now', $data); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function getSocialLink(GetRequest $request) |
57 | 57 | { |
58 | 58 | return response()->json([ |
59 | - 'link' => auth()->user()->profile[$request->platform], |
|
59 | + 'link' => auth()->user()->profile[ $request->platform ], |
|
60 | 60 | ]); |
61 | 61 | } |
62 | 62 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function saveSocialLink(UpdateRequest $request) |
70 | 70 | { |
71 | 71 | $profile = auth()->user()->profile; |
72 | - $profile[$request->platform] = $request->link; |
|
72 | + $profile[ $request->platform ] = $request->link; |
|
73 | 73 | try { |
74 | 74 | $profile->save(); |
75 | 75 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | $this->deleteFiles(auth()->user()); |
112 | 112 | } |
113 | 113 | |
114 | - $fileName = str_shuffle(auth()->user()->id.time().time()).'.png'; |
|
115 | - $ogSave = storage_path('app/public/profile/original/').$fileName; |
|
114 | + $fileName = str_shuffle(auth()->user()->id . time() . time()) . '.png'; |
|
115 | + $ogSave = storage_path('app/public/profile/original/') . $fileName; |
|
116 | 116 | $imageManager->make($request->image)->save($ogSave); |
117 | - $image = auth()->user()->image()->updateOrCreate([], [ |
|
117 | + $image = auth()->user()->image()->updateOrCreate([ ], [ |
|
118 | 118 | 'name' => $fileName, |
119 | 119 | ]); |
120 | 120 | |
@@ -179,25 +179,25 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function updateProfile(UpdateProfileRequest $request) |
181 | 181 | { |
182 | - $ministryParams = $request->only(['name', 'email', 'phone']); |
|
182 | + $ministryParams = $request->only([ 'name', 'email', 'phone' ]); |
|
183 | 183 | |
184 | 184 | auth()->user()->update($ministryParams); |
185 | 185 | |
186 | - $links = ['website', 'facebook', 'youtube', 'twitter', 'instagram']; |
|
187 | - $statements = ['vision', 'mission', 'about_us']; |
|
186 | + $links = [ 'website', 'facebook', 'youtube', 'twitter', 'instagram' ]; |
|
187 | + $statements = [ 'vision', 'mission', 'about_us' ]; |
|
188 | 188 | |
189 | - $params = ['color' => $request->color]; |
|
189 | + $params = [ 'color' => $request->color ]; |
|
190 | 190 | |
191 | - $params = array_merge($params, array_filter($request->links, fn ($link) => in_array($link, $links), ARRAY_FILTER_USE_KEY)); |
|
191 | + $params = array_merge($params, array_filter($request->links, fn($link) => in_array($link, $links), ARRAY_FILTER_USE_KEY)); |
|
192 | 192 | |
193 | - $params = array_merge($params, array_filter($request->statement, fn ($link) => in_array($link, $statements), ARRAY_FILTER_USE_KEY)); |
|
193 | + $params = array_merge($params, array_filter($request->statement, fn($link) => in_array($link, $statements), ARRAY_FILTER_USE_KEY)); |
|
194 | 194 | |
195 | - $params = array_merge($params, ['emails' => $request->emails]); |
|
195 | + $params = array_merge($params, [ 'emails' => $request->emails ]); |
|
196 | 196 | |
197 | - $params = array_merge($params, ['phones' => $request->phones]); |
|
197 | + $params = array_merge($params, [ 'phones' => $request->phones ]); |
|
198 | 198 | |
199 | 199 | if ($request->has('location')) { |
200 | - $params = array_merge($params, ['location' => $request->location]); |
|
200 | + $params = array_merge($params, [ 'location' => $request->location ]); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $this->saveServices($request, auth()->user()); |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | ->whereIn('id', $ministry->services()->pluck('id')->toArray()) |
219 | 219 | ->delete(); |
220 | 220 | |
221 | - $services = array_map(function ($service) { |
|
221 | + $services = array_map(function($service) { |
|
222 | 222 | return array_merge($service, [ |
223 | - 'id' => str_shuffle((string) Str::uuid()), |
|
223 | + 'id' => str_shuffle((string)Str::uuid()), |
|
224 | 224 | 'ministry_id' => auth()->user()->id, |
225 | 225 | 'created_at' => now(), |
226 | 226 | 'updated_at' => now(), |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function getLinks($links) |
240 | 240 | { |
241 | - $_links = ['website', 'facebook', 'youtube', 'twitter', 'instagram']; |
|
241 | + $_links = [ 'website', 'facebook', 'youtube', 'twitter', 'instagram' ]; |
|
242 | 242 | |
243 | 243 | return array_key_exists($links, $_links); |
244 | 244 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | ->ministryUsers() |
266 | 266 | ->latest() |
267 | 267 | //->with(['user.image']) |
268 | - ->where(fn ($ministryUser) => $ministryUser->whereHas('user', fn ($user) => $user->search(['name', 'email'], $request->filter_text))) |
|
268 | + ->where(fn($ministryUser) => $ministryUser->whereHas('user', fn($user) => $user->search([ 'name', 'email' ], $request->filter_text))) |
|
269 | 269 | ->paginate(Helper::getLimit($request)); |
270 | 270 | |
271 | 271 | //return $ministryUsers; |