@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function up(): void |
42 | 42 | { |
43 | - $this->createSchema(function (Blueprint $table) { |
|
43 | + $this->createSchema(function(Blueprint $table) { |
|
44 | 44 | $table->id(); |
45 | 45 | $table->morphs('two_factorable'); |
46 | 46 | $table->text('secret')->nullable(); |
@@ -96,8 +96,8 @@ |
||
96 | 96 | 'two_factors' => 'two_factors', |
97 | 97 | ], |
98 | 98 | |
99 | - // Models |
|
100 | - // ---------------------------------- |
|
99 | + // Models |
|
100 | + // ---------------------------------- |
|
101 | 101 | |
102 | 102 | 'models' => [ |
103 | 103 | 'user' => App\Models\User::class, |
@@ -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 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | protected function moduleGroup(Closure $callback) |
28 | 28 | { |
29 | 29 | $this->prefix('system') |
30 | - ->name('system.') |
|
31 | - ->group($callback); |
|
30 | + ->name('system.') |
|
31 | + ->group($callback); |
|
32 | 32 | } |
33 | 33 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | */ |
59 | 59 | public function compose(View $view): void |
60 | 60 | { |
61 | - $metrics = $this->manager->makeSelected()->filter(function ($metric) { |
|
61 | + $metrics = $this->manager->makeSelected()->filter(function($metric) { |
|
62 | 62 | return $metric->authorizedToSee(request()); |
63 | 63 | }); |
64 | 64 |
@@ -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 | /* ----------------------------------------------------------------- |
@@ -61,12 +61,12 @@ |
||
61 | 61 | */ |
62 | 62 | private function registerBladeComponents(): void |
63 | 63 | { |
64 | - $this->callAfterResolving(BladeCompiler::class, function (BladeCompiler $blade, $app) { |
|
64 | + $this->callAfterResolving(BladeCompiler::class, function(BladeCompiler $blade, $app) { |
|
65 | 65 | $prefix = $app['config']->get('arcanesoft.foundation.view.prefix', ''); |
66 | 66 | $components = $app['config']->get('arcanesoft.foundation.view.components', []); |
67 | 67 | |
68 | 68 | $blade->components( |
69 | - Collection::make($components)->mapWithKeys(function ($component, $key) use ($prefix) { |
|
69 | + Collection::make($components)->mapWithKeys(function($component, $key) use ($prefix) { |
|
70 | 70 | return ["{$prefix}{$key}" => $component]; |
71 | 71 | })->toArray() |
72 | 72 | ); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function calculate(Request $request, RolesRepository $repo) |
35 | 35 | { |
36 | 36 | // Calculate roles with users count |
37 | - $result = $repo->withCount(['administrators'])->get()->filter(function ($role) { |
|
37 | + $result = $repo->withCount(['administrators'])->get()->filter(function($role) { |
|
38 | 38 | return $role->administrators_count > 0; |
39 | 39 | })->pluck('administrators_count', 'name'); |
40 | 40 |