@@ -97,8 +97,9 @@ |
||
97 | 97 | { |
98 | 98 | $url = $this->redirectUrlAfterLogout($request); |
99 | 99 | |
100 | - if ($request->wantsJson()) |
|
101 | - return new Response(['redirect' => $url]); |
|
100 | + if ($request->wantsJson()) { |
|
101 | + return new Response(['redirect' => $url]); |
|
102 | + } |
|
102 | 103 | |
103 | 104 | return redirect()->to($url); |
104 | 105 | } |
@@ -40,13 +40,15 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function form(string $view, Request $request = null) |
42 | 42 | { |
43 | - if (is_null($request)) |
|
44 | - $request = request(); |
|
43 | + if (is_null($request)) { |
|
44 | + $request = request(); |
|
45 | + } |
|
45 | 46 | |
46 | - if (is_null($request->session()->get('login.id'))) |
|
47 | - return redirect()->to( |
|
47 | + if (is_null($request->session()->get('login.id'))) { |
|
48 | + return redirect()->to( |
|
48 | 49 | $this->getFailedTwoFactorRedirectUrl($request) |
49 | 50 | ); |
51 | + } |
|
50 | 52 | |
51 | 53 | $request->session()->reflash(); |
52 | 54 | |
@@ -71,8 +73,7 @@ discard block |
||
71 | 73 | if ($code = $request->validRecoveryCode()) { |
72 | 74 | $this->getTwoFactorAuthenticationRepository() |
73 | 75 | ->replaceRecoveryCode($user, $code); |
74 | - } |
|
75 | - elseif ( ! $request->hasValidCode()) { |
|
76 | + } elseif ( ! $request->hasValidCode()) { |
|
76 | 77 | return $this->getFailedTwoFactorLoginResponse($request); |
77 | 78 | } |
78 | 79 | |
@@ -91,8 +92,9 @@ discard block |
||
91 | 92 | */ |
92 | 93 | protected function getTwoFactorLoginResponse(Request $request, $user) |
93 | 94 | { |
94 | - if ($request->wantsJson()) |
|
95 | - return new Response('', Response::HTTP_NO_CONTENT); |
|
95 | + if ($request->wantsJson()) { |
|
96 | + return new Response('', Response::HTTP_NO_CONTENT); |
|
97 | + } |
|
96 | 98 | |
97 | 99 | return redirect()->to($this->getRedirectUrlAfterLogin($request, $user)); |
98 | 100 | } |
@@ -46,8 +46,9 @@ discard block |
||
46 | 46 | event(new PasswordReset($user)); |
47 | 47 | }); |
48 | 48 | |
49 | - if ($status === Password::PASSWORD_RESET) |
|
50 | - return $this->getSuccessResponse($request, $status); |
|
49 | + if ($status === Password::PASSWORD_RESET) { |
|
50 | + return $this->getSuccessResponse($request, $status); |
|
51 | + } |
|
51 | 52 | |
52 | 53 | return $this->getFailedResponse($request, $status); |
53 | 54 | } |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | { |
83 | 84 | $status = trans($status); |
84 | 85 | |
85 | - if ($request->wantsJson()) |
|
86 | - return new JsonResponse(['message' => $status], JsonResponse::HTTP_OK); |
|
86 | + if ($request->wantsJson()) { |
|
87 | + return new JsonResponse(['message' => $status], JsonResponse::HTTP_OK); |
|
88 | + } |
|
87 | 89 | |
88 | 90 | return redirect() |
89 | 91 | ->to($this->getRedirectUrl()) |
@@ -62,8 +62,9 @@ |
||
62 | 62 | { |
63 | 63 | $status = trans($status); |
64 | 64 | |
65 | - if ($request->wantsJson()) |
|
66 | - return new JsonResponse(['message' => trans($status)], JsonResponse::HTTP_OK); |
|
65 | + if ($request->wantsJson()) { |
|
66 | + return new JsonResponse(['message' => trans($status)], JsonResponse::HTTP_OK); |
|
67 | + } |
|
67 | 68 | |
68 | 69 | return redirect() |
69 | 70 | ->back() |
@@ -82,8 +82,9 @@ |
||
82 | 82 | */ |
83 | 83 | protected function getRegisteredResponse(Request $request, $user) |
84 | 84 | { |
85 | - if ($request->wantsJson()) |
|
86 | - new Response('', Response::HTTP_CREATED); |
|
85 | + if ($request->wantsJson()) { |
|
86 | + new Response('', Response::HTTP_CREATED); |
|
87 | + } |
|
87 | 88 | |
88 | 89 | return redirect()->to($this->redirectUrlAfterRegister($request, $user)); |
89 | 90 | } |
@@ -63,11 +63,13 @@ |
||
63 | 63 | */ |
64 | 64 | public function handle(Request $request, Closure $next) |
65 | 65 | { |
66 | - if ( ! $this->limiter->isEnabled()) |
|
67 | - return $next($request); |
|
66 | + if ( ! $this->limiter->isEnabled()) { |
|
67 | + return $next($request); |
|
68 | + } |
|
68 | 69 | |
69 | - if ( ! $this->limiter->tooManyAttempts($request)) |
|
70 | - return $next($request); |
|
70 | + if ( ! $this->limiter->tooManyAttempts($request)) { |
|
71 | + return $next($request); |
|
72 | + } |
|
71 | 73 | |
72 | 74 | event(new Lockout($request)); |
73 | 75 |
@@ -26,8 +26,9 @@ |
||
26 | 26 | */ |
27 | 27 | protected function passesAuthorization(): bool |
28 | 28 | { |
29 | - if (method_exists($this, 'authorize')) |
|
30 | - return app()->call([$this, 'authorize']); |
|
29 | + if (method_exists($this, 'authorize')) { |
|
30 | + return app()->call([$this, 'authorize']); |
|
31 | + } |
|
31 | 32 | |
32 | 33 | return true; |
33 | 34 | } |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | if ($type === 'method') { |
34 | 34 | $this->handleMethodAction($payload['method'], $payload['params']); |
35 | - } |
|
36 | - elseif ($type === 'model') { |
|
35 | + } elseif ($type === 'model') { |
|
37 | 36 | $this->handleModelAction($payload['name'], $payload['value']); |
38 | 37 | } |
39 | 38 | } |
@@ -60,8 +59,9 @@ discard block |
||
60 | 59 | { |
61 | 60 | $method = 'updating'.Str::studly($property); |
62 | 61 | |
63 | - if (method_exists($this, $method)) |
|
64 | - $this->$method(); |
|
62 | + if (method_exists($this, $method)) { |
|
63 | + $this->$method(); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | $this->{$property} = $value; |
67 | 67 | } |
@@ -42,8 +42,9 @@ discard block |
||
42 | 42 | { |
43 | 43 | $data = $this->data(); |
44 | 44 | |
45 | - if (method_exists($this, 'initializeWithPagination')) |
|
46 | - $this->initializeWithPagination(); |
|
45 | + if (method_exists($this, 'initializeWithPagination')) { |
|
46 | + $this->initializeWithPagination(); |
|
47 | + } |
|
47 | 48 | |
48 | 49 | /** @var \Illuminate\View\View $view */ |
49 | 50 | $view = app()->call([$this, 'render']); |
@@ -87,8 +88,9 @@ discard block |
||
87 | 88 | |
88 | 89 | $actions = (array) $request->input('actions'); |
89 | 90 | |
90 | - if ( ! empty($actions)) |
|
91 | - $this->handleComponentActions($actions); |
|
91 | + if ( ! empty($actions)) { |
|
92 | + $this->handleComponentActions($actions); |
|
93 | + } |
|
92 | 94 | |
93 | 95 | return $this; |
94 | 96 | } |