@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | public static function register() |
15 | 15 | { |
16 | - Blade::if('role', function ($role) { |
|
16 | + Blade::if ('role', function($role) { |
|
17 | 17 | return auth()->check() && auth()->user()->hasRole($role); |
18 | 18 | }); |
19 | 19 | |
20 | - Blade::if('anyrole', function ($roles) { |
|
20 | + Blade::if ('anyrole', function($roles) { |
|
21 | 21 | return auth()->check() && auth()->user()->hasAnyRole(explode('|', $roles)); |
22 | 22 | }); |
23 | 23 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | Route::namespace('\Thinkstudeo\Rakshak\Http\Controllers') |
50 | 50 | ->middleware(['web', 'auth']) |
51 | 51 | ->prefix(config('rakshak.route_prefix')) |
52 | - ->group(function () { |
|
52 | + ->group(function() { |
|
53 | 53 | Route::get('login/2fa', 'TwoFactorController@showOtpForm')->name('rakshak.2fa.show'); |
54 | 54 | Route::post('login/2fa/verify', 'TwoFactorController@verifyOtp')->name('rakshak.2fa.verify'); |
55 | 55 |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | public function handle($request, \Closure $next, $role) |
18 | 18 | { |
19 | - if (! $request->user()) { |
|
19 | + if (!$request->user()) { |
|
20 | 20 | return redirect(route('login')); |
21 | 21 | } |
22 | 22 | |
23 | 23 | $roles = is_string($role) ? explode('|', $role) : $role; |
24 | 24 | |
25 | - if (! $request->user()->hasAnyRole($roles)) { |
|
25 | + if (!$request->user()->hasAnyRole($roles)) { |
|
26 | 26 | abort(Response::HTTP_FORBIDDEN, 'You do not have the permission.'); |
27 | 27 | } |
28 | 28 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | protected function exportRoutes() |
60 | 60 | { |
61 | 61 | if ( |
62 | - ! Str::contains(file_get_contents(base_path('routes/web.php')), 'Auth::routes') || |
|
62 | + !Str::contains(file_get_contents(base_path('routes/web.php')), 'Auth::routes') || |
|
63 | 63 | $this->option('force') |
64 | 64 | ) { |
65 | 65 | file_put_contents( |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | protected function makeControllers() |
90 | 90 | { |
91 | 91 | foreach ($this->controllers as $key => $value) { |
92 | - if (! file_exists(app_path($value)) || $this->option('force')) { |
|
92 | + if (!file_exists(app_path($value)) || $this->option('force')) { |
|
93 | 93 | file_put_contents( |
94 | 94 | app_path($value), |
95 | 95 | $this->compileStub(__DIR__."/stubs/controllers/{$key}") |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | */ |
120 | 120 | protected function createDirectories() |
121 | 121 | { |
122 | - if (! is_dir($directory = resource_path('views/layouts'))) { |
|
122 | + if (!is_dir($directory = resource_path('views/layouts'))) { |
|
123 | 123 | mkdir($directory, 0755, true); |
124 | 124 | } |
125 | 125 | |
126 | - if (! is_dir($directory = resource_path('views/auth/passwords'))) { |
|
126 | + if (!is_dir($directory = resource_path('views/auth/passwords'))) { |
|
127 | 127 | mkdir($directory, 0755, true); |
128 | 128 | } |
129 | 129 | |
130 | - if (! is_dir($directory = app_path('Notifications/Rakshak'))) { |
|
130 | + if (!is_dir($directory = app_path('Notifications/Rakshak'))) { |
|
131 | 131 | mkdir($directory, 0755, true); |
132 | 132 | } |
133 | 133 | } |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | protected function exportViews() |
156 | 156 | { |
157 | 157 | foreach ($this->views as $key => $value) { |
158 | - if (file_exists($view = resource_path('views/'.$value)) && ! $this->option('force')) { |
|
159 | - if (! $this->confirm("The [{$value}] view already exists. Do you want to replace it?")) { |
|
158 | + if (file_exists($view = resource_path('views/'.$value)) && !$this->option('force')) { |
|
159 | + if (!$this->confirm("The [{$value}] view already exists. Do you want to replace it?")) { |
|
160 | 160 | continue; |
161 | 161 | } |
162 | 162 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $filename = str_replace('stub', 'php', basename($stub)); |
182 | 182 | $path = app_path("Notifications/Rakshak/{$filename}"); |
183 | 183 | |
184 | - if (! file_exists($path) || $this->option('force')) { |
|
184 | + if (!file_exists($path) || $this->option('force')) { |
|
185 | 185 | file_put_contents( |
186 | 186 | $path, |
187 | 187 | $this->compileStub($stub->getPathname()) |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | config('auth.providers.users.model') |
205 | 205 | ), '\\'); |
206 | 206 | if ( |
207 | - ! str_contains(file_get_contents(app_path('User.php')), 'HasRakshak') || |
|
207 | + !str_contains(file_get_contents(app_path('User.php')), 'HasRakshak') || |
|
208 | 208 | $this->option('force') |
209 | 209 | ) { |
210 | 210 | file_put_contents( |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public static function bootUuidAsPrimaryKey(): void |
16 | 16 | { |
17 | - static::creating(function ($model) { |
|
17 | + static::creating(function($model) { |
|
18 | 18 | $model->{$model->getKeyName()} = Str::orderedUuid()->toString(); |
19 | 19 | }); |
20 | 20 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | protected function mergeConfig(): void |
71 | 71 | { |
72 | - if (! $this->app->configurationIsCached()) { |
|
72 | + if (!$this->app->configurationIsCached()) { |
|
73 | 73 | $this->mergeConfigFrom(__DIR__.'/../config/rakshak.php', 'rakshak'); |
74 | 74 | } |
75 | 75 | } |