@@ -239,14 +239,15 @@ |
||
239 | 239 | */ |
240 | 240 | protected function parseUrl(array $attributes) : void |
241 | 241 | { |
242 | - if (isset($attributes['url'])) |
|
243 | - $this->setUrl($attributes['url']); |
|
244 | - elseif (isset($attributes['route'])) |
|
245 | - $this->route(...Arr::wrap($attributes['route'])); |
|
246 | - elseif (isset($attributes['action'])) |
|
247 | - $this->action(...Arr::wrap($attributes['action'])); |
|
248 | - else |
|
249 | - $this->setUrl('#'); |
|
242 | + if (isset($attributes['url'])) { |
|
243 | + $this->setUrl($attributes['url']); |
|
244 | + } elseif (isset($attributes['route'])) { |
|
245 | + $this->route(...Arr::wrap($attributes['route'])); |
|
246 | + } elseif (isset($attributes['action'])) { |
|
247 | + $this->action(...Arr::wrap($attributes['action'])); |
|
248 | + } else { |
|
249 | + $this->setUrl('#'); |
|
250 | + } |
|
250 | 251 | } |
251 | 252 | |
252 | 253 | /** |
@@ -74,8 +74,7 @@ |
||
74 | 74 | foreach ($items as $item) { |
75 | 75 | if (is_array($item)) { |
76 | 76 | $this->items->pushSidebarItem($item); |
77 | - } |
|
78 | - elseif (config()->has($item)) { |
|
77 | + } elseif (config()->has($item)) { |
|
79 | 78 | $this->loadFromConfig(config()->get($item)); |
80 | 79 | } |
81 | 80 | } |
@@ -74,8 +74,9 @@ |
||
74 | 74 | { |
75 | 75 | $ips = explode(PHP_EOL, (string) $this->input('allowed')); |
76 | 76 | |
77 | - if ((bool) $this->input('allow_current_ip')) |
|
78 | - $ips[] = $this->ip(); |
|
77 | + if ((bool) $this->input('allow_current_ip')) { |
|
78 | + $ips[] = $this->ip(); |
|
79 | + } |
|
79 | 80 | |
80 | 81 | return array_unique(array_filter($ips)); |
81 | 82 | } |
@@ -117,8 +117,9 @@ discard block |
||
117 | 117 | { |
118 | 118 | $this->authorize(LogViewerPolicy::ability('delete')); |
119 | 119 | |
120 | - if ( ! $this->logViewer->delete($date)) |
|
121 | - return $this->jsonResponseError(); |
|
120 | + if ( ! $this->logViewer->delete($date)) { |
|
121 | + return $this->jsonResponseError(); |
|
122 | + } |
|
122 | 123 | |
123 | 124 | $this->notifySuccess(__('Log Deleted'), __('The log file has been successfully deleted!')); |
124 | 125 | |
@@ -164,8 +165,7 @@ discard block |
||
164 | 165 | { |
165 | 166 | try { |
166 | 167 | return $this->logViewer->get($date); |
167 | - } |
|
168 | - catch (LogNotFoundException $e) { |
|
168 | + } catch (LogNotFoundException $e) { |
|
169 | 169 | abort(404, $e->getMessage()); |
170 | 170 | } |
171 | 171 |
@@ -56,11 +56,13 @@ discard block |
||
56 | 56 | { |
57 | 57 | $user = $request->user(); |
58 | 58 | |
59 | - if (is_null($user)) |
|
60 | - return false; |
|
59 | + if (is_null($user)) { |
|
60 | + return false; |
|
61 | + } |
|
61 | 62 | |
62 | - if ( ! $user instanceof MustVerifyEmail) |
|
63 | - return false; |
|
63 | + if ( ! $user instanceof MustVerifyEmail) { |
|
64 | + return false; |
|
65 | + } |
|
64 | 66 | |
65 | 67 | return ! $user->hasVerifiedEmail(); |
66 | 68 | } |
@@ -75,8 +77,9 @@ discard block |
||
75 | 77 | */ |
76 | 78 | protected function getMustBeVerifiedResponse(Request $request, string $redirectToRoute) |
77 | 79 | { |
78 | - if ($request->expectsJson()) |
|
79 | - abort(Response::HTTP_FORBIDDEN, 'Your email address is not verified.'); |
|
80 | + if ($request->expectsJson()) { |
|
81 | + abort(Response::HTTP_FORBIDDEN, 'Your email address is not verified.'); |
|
82 | + } |
|
80 | 83 | |
81 | 84 | return redirect()->route($redirectToRoute); |
82 | 85 | } |
@@ -206,17 +206,21 @@ |
||
206 | 206 | */ |
207 | 207 | public function passes($attribute, $value): bool |
208 | 208 | { |
209 | - if ($this->requireUppercase && Str::lower($value) === $value) |
|
210 | - return $this->fail('The :attribute must contain at least one uppercase character.'); |
|
209 | + if ($this->requireUppercase && Str::lower($value) === $value) { |
|
210 | + return $this->fail('The :attribute must contain at least one uppercase character.'); |
|
211 | + } |
|
211 | 212 | |
212 | - if ($this->requireNumeric && ! preg_match('/[0-9]/', $value)) |
|
213 | - return $this->fail('The :attribute must contain at least one number.'); |
|
213 | + if ($this->requireNumeric && ! preg_match('/[0-9]/', $value)) { |
|
214 | + return $this->fail('The :attribute must contain at least one number.'); |
|
215 | + } |
|
214 | 216 | |
215 | - if ($this->requireSpecialCharacter && ! preg_match('/[\W_]/', $value)) |
|
216 | - return $this->fail('The :attribute must contain at least one special character.'); |
|
217 | + if ($this->requireSpecialCharacter && ! preg_match('/[\W_]/', $value)) { |
|
218 | + return $this->fail('The :attribute must contain at least one special character.'); |
|
219 | + } |
|
217 | 220 | |
218 | - if (Str::length($value) < $this->length) |
|
219 | - return $this->fail("The :attribute must be at least {$this->length} characters."); |
|
221 | + if (Str::length($value) < $this->length) { |
|
222 | + return $this->fail("The :attribute must be at least {$this->length} characters."); |
|
223 | + } |
|
220 | 224 | |
221 | 225 | return true; |
222 | 226 | } |
@@ -33,8 +33,9 @@ |
||
33 | 33 | */ |
34 | 34 | public function __construct(string $label = null) |
35 | 35 | { |
36 | - if ( ! empty($label)) |
|
37 | - $this->label = __($label); |
|
36 | + if ( ! empty($label)) { |
|
37 | + $this->label = __($label); |
|
38 | + } |
|
38 | 39 | } |
39 | 40 | |
40 | 41 | /* ----------------------------------------------------------------- |
@@ -160,8 +160,9 @@ discard block |
||
160 | 160 | foreach ($model->getDirty() as $name => $value) { |
161 | 161 | $event = $name.'.'.$type; |
162 | 162 | |
163 | - if ( ! array_key_exists($event, $attributesEvents)) |
|
164 | - continue; |
|
163 | + if ( ! array_key_exists($event, $attributesEvents)) { |
|
164 | + continue; |
|
165 | + } |
|
165 | 166 | |
166 | 167 | return in_array($name, $model->getHidden()) |
167 | 168 | ? event(new $attributesEvents[$event]($model)) |
@@ -214,8 +215,9 @@ discard block |
||
214 | 215 | */ |
215 | 216 | public function activateOne(User $user) |
216 | 217 | { |
217 | - if ($user->isActive()) |
|
218 | - return false; |
|
218 | + if ($user->isActive()) { |
|
219 | + return false; |
|
220 | + } |
|
219 | 221 | |
220 | 222 | event(new ActivatingUser($user)); |
221 | 223 | $result = $user->forceFill(['activated_at' => $user->freshTimestamp()])->save(); |
@@ -233,8 +235,9 @@ discard block |
||
233 | 235 | */ |
234 | 236 | public function deactivateOne(User $user): bool |
235 | 237 | { |
236 | - if ( ! $user->isActive()) |
|
237 | - return false; |
|
238 | + if ( ! $user->isActive()) { |
|
239 | + return false; |
|
240 | + } |
|
238 | 241 | |
239 | 242 | event(new DeactivatingUser($user)); |
240 | 243 | $result = $user->forceFill(['activated_at' => null])->save(); |
@@ -264,8 +267,9 @@ discard block |
||
264 | 267 | */ |
265 | 268 | public function restoreOne(User $user) |
266 | 269 | { |
267 | - if ( ! $user->trashed()) |
|
268 | - return null; |
|
270 | + if ( ! $user->trashed()) { |
|
271 | + return null; |
|
272 | + } |
|
269 | 273 | |
270 | 274 | return $user->restore(); |
271 | 275 | } |
@@ -193,8 +193,9 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function syncPermissionsByIds(Role $role, array $ids): array |
195 | 195 | { |
196 | - if (empty($ids)) |
|
197 | - return []; |
|
196 | + if (empty($ids)) { |
|
197 | + return []; |
|
198 | + } |
|
198 | 199 | |
199 | 200 | event(new SyncingPermissions($role, $ids)); |
200 | 201 | $synced = $role->permissions()->sync($ids); |
@@ -302,8 +303,9 @@ discard block |
||
302 | 303 | */ |
303 | 304 | public function activateOne(Role $role): bool |
304 | 305 | { |
305 | - if ($role->isActive()) |
|
306 | - return false; |
|
306 | + if ($role->isActive()) { |
|
307 | + return false; |
|
308 | + } |
|
307 | 309 | |
308 | 310 | event(new ActivatingRole($role)); |
309 | 311 | $result = $role->forceFill(['activated_at' => $role->freshTimestamp()])->save(); |
@@ -321,8 +323,9 @@ discard block |
||
321 | 323 | */ |
322 | 324 | public function deactivateOne(Role $role): bool |
323 | 325 | { |
324 | - if ( ! $role->isActive()) |
|
325 | - return false; |
|
326 | + if ( ! $role->isActive()) { |
|
327 | + return false; |
|
328 | + } |
|
326 | 329 | |
327 | 330 | event(new DeactivatingRole($role)); |
328 | 331 | $result = $role->forceFill(['activated_at' => null])->save(); |
@@ -354,8 +357,9 @@ discard block |
||
354 | 357 | { |
355 | 358 | $roles = $this->get(); |
356 | 359 | |
357 | - if ($admin->isSuperAdmin()) |
|
358 | - return $roles; |
|
360 | + if ($admin->isSuperAdmin()) { |
|
361 | + return $roles; |
|
362 | + } |
|
359 | 363 | |
360 | 364 | return $roles->reject(function (Role $role) { |
361 | 365 | return $role->isAdministrator(); |