@@ -12,12 +12,12 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $optimizerChain = app(OptimizerChain::class); |
| 14 | 14 | |
| 15 | - collect($request->allFiles())->each(function ($file) use ($optimizerChain) { |
|
| 15 | + collect($request->allFiles())->each(function($file) use ($optimizerChain) { |
|
| 16 | 16 | if (is_array($file)) { |
| 17 | - collect($file)->each(function ($media) use ($optimizerChain) { |
|
| 17 | + collect($file)->each(function($media) use ($optimizerChain) { |
|
| 18 | 18 | $optimizerChain->optimize($media->getPathname()); |
| 19 | 19 | }); |
| 20 | - } else { |
|
| 20 | + }else { |
|
| 21 | 21 | $optimizerChain->optimize($file->getPathname()); |
| 22 | 22 | } |
| 23 | 23 | }); |
@@ -18,9 +18,9 @@ |
||
| 18 | 18 | |
| 19 | 19 | $onlineModels = UrlHelper::onlineModels(); |
| 20 | 20 | |
| 21 | - $links = $onlineModels->reject(function (Visitable $model) { |
|
| 22 | - return ! $model->url(); |
|
| 23 | - })->map(function ($model) { |
|
| 21 | + $links = $onlineModels->reject(function(Visitable $model) { |
|
| 22 | + return !$model->url(); |
|
| 23 | + })->map(function($model) { |
|
| 24 | 24 | $name = (method_exists($model, 'menuLabel') && $model->menuLabel()) ? $model->menuLabel() : (isset($model->title) ? $model->title : $model->url()); |
| 25 | 25 | |
| 26 | 26 | return [ |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | // Here we will attempt to reset the user's password. If it is successful we |
| 66 | 66 | // will update the password on an actual user model and persist it to the |
| 67 | 67 | // database. Otherwise we will parse the error and return the response. |
| 68 | - $response = $this->broker()->reset($this->credentials($request), function ($user, $password) { |
|
| 68 | + $response = $this->broker()->reset($this->credentials($request), function($user, $password) { |
|
| 69 | 69 | $this->resetPassword($user, $password); |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $user = auth()->guard('chief')->user(); |
| 18 | 18 | |
| 19 | - return view('chief::admin.auth.passwords.edit', ['new_password' => ! $user->password]); |
|
| 19 | + return view('chief::admin.auth.passwords.edit', ['new_password' => !$user->password]); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function update(Request $request) |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | return redirect('/'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if (! $request->user('chief')->hasRole($role)) { |
|
| 23 | + if (!$request->user('chief')->hasRole($role)) { |
|
| 24 | 24 | abort(403); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if (! $request->user('chief')->can($permission)) { |
|
| 27 | + if (!$request->user('chief')->can($permission)) { |
|
| 28 | 28 | abort(403); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function handle($request, Closure $next) |
| 19 | 19 | { |
| 20 | - if (! $request->user('chief') || ! $request->session()) { |
|
| 20 | + if (!$request->user('chief') || !$request->session()) { |
|
| 21 | 21 | return $next($request); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if (! $request->session()->has('chief_password_hash')) { |
|
| 32 | + if (!$request->session()->has('chief_password_hash')) { |
|
| 33 | 33 | $this->storePasswordHashInSession($request); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->logout($request); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - return tap($next($request), function () use ($request) { |
|
| 40 | + return tap($next($request), function() use ($request) { |
|
| 41 | 41 | $this->storePasswordHashInSession($request); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | protected function storePasswordHashInSession($request) |
| 52 | 52 | { |
| 53 | - if (! $request->user('chief')) { |
|
| 53 | + if (!$request->user('chief')) { |
|
| 54 | 54 | return; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | { |
| 39 | 39 | // Low level way to only allow TT users |
| 40 | 40 | // this is not a safe way to handle security and is only used for convenience, not to secure page restriction!! |
| 41 | - if (! $this->auth->user() || ! $this->authorize('update-squanto')) { |
|
| 41 | + if (!$this->auth->user() || !$this->authorize('update-squanto')) { |
|
| 42 | 42 | if ($request->ajax()) { |
| 43 | 43 | return response('Unauthorized.', 401); |
| 44 | - } else { |
|
| 44 | + }else { |
|
| 45 | 45 | return redirect()->guest('admin/login'); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return redirect('/'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if (! $request->user('chief')->can($permission)) { |
|
| 23 | + if (!$request->user('chief')->can($permission)) { |
|
| 24 | 24 | abort(403); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -18,17 +18,17 @@ |
||
| 18 | 18 | public function handle($request, Closure $next) |
| 19 | 19 | { |
| 20 | 20 | // Verifies a valid signature and still outside expiration period |
| 21 | - if (! $request->hasValidSignature()) { |
|
| 21 | + if (!$request->hasValidSignature()) { |
|
| 22 | 22 | return redirect()->route('invite.expired'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (! $invitation = Invitation::findByToken($request->token)) { |
|
| 25 | + if (!$invitation = Invitation::findByToken($request->token)) { |
|
| 26 | 26 | return redirect()->route('invite.expired'); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | if (in_array($invitation->getState(InvitationState::KEY), [InvitationState::accepted, InvitationState::revoked])) { |
| 30 | 30 | // We allow the user to pass if the invitee is already logged in. Otherwise the invite link cannot be reused. |
| 31 | - if (! auth()->guard('chief')->check() || ! auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 31 | + if (!auth()->guard('chief')->check() || !auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 32 | 32 | return redirect()->route('invite.expired'); |
| 33 | 33 | } |
| 34 | 34 | } |