@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->configureRateLimiting(); |
| 39 | 39 | |
| 40 | - $this->routes(function () { |
|
| 40 | + $this->routes(function() { |
|
| 41 | 41 | Route::prefix('api') |
| 42 | 42 | ->middleware('api') |
| 43 | 43 | ->namespace($this->namespace) |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function configureRateLimiting() |
| 58 | 58 | { |
| 59 | - RateLimiter::for('api', function (Request $request) { |
|
| 59 | + RateLimiter::for ('api', function(Request $request) { |
|
| 60 | 60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function store(Request $request) |
| 30 | 30 | { |
| 31 | - if (! Auth::guard('web')->validate([ |
|
| 31 | + if (!Auth::guard('web')->validate([ |
|
| 32 | 32 | 'email' => $request->user()->email, |
| 33 | 33 | 'password' => $request->password, |
| 34 | 34 | ])) { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | // database. Otherwise we will parse the error and return the response. |
| 45 | 45 | $status = Password::reset( |
| 46 | 46 | $request->only('email', 'password', 'password_confirmation', 'token'), |
| 47 | - function ($user) use ($request) { |
|
| 47 | + function($user) use ($request) { |
|
| 48 | 48 | $user->forceFill([ |
| 49 | 49 | 'password' => Hash::make($request->password), |
| 50 | 50 | 'remember_token' => Str::random(60), |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | public function mount() |
| 19 | 19 | { |
| 20 | 20 | $settings = Setting::pluck('value', 'key')->toArray(); |
| 21 | - $this->site_url = Arr::get($settings,'site_url'); |
|
| 22 | - $this->username = Arr::get($settings,'username'); |
|
| 21 | + $this->site_url = Arr::get($settings, 'site_url'); |
|
| 22 | + $this->username = Arr::get($settings, 'username'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function render() |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | 'password' => 'required', |
| 44 | 44 | ]); |
| 45 | 45 | |
| 46 | - foreach($validatedDate as $key => $item) { |
|
| 46 | + foreach ($validatedDate as $key => $item) { |
|
| 47 | 47 | $setting = Setting::firstOrNew(['key' => $key]); |
| 48 | 48 | $setting->value = $item; |
| 49 | 49 | $setting->save(); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | protected function redirectTo($request) |
| 16 | 16 | { |
| 17 | - if (! $request->expectsJson()) { |
|
| 17 | + if (!$request->expectsJson()) { |
|
| 18 | 18 | return route('login'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->ensureIsNotRateLimited(); |
| 47 | 47 | |
| 48 | - if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { |
|
| 48 | + if (!Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { |
|
| 49 | 49 | RateLimiter::hit($this->throttleKey()); |
| 50 | 50 | |
| 51 | 51 | throw ValidationException::withMessages([ |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function ensureIsNotRateLimited() |
| 67 | 67 | { |
| 68 | - if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 68 | + if (!RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 69 | 69 | return; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function register() |
| 36 | 36 | { |
| 37 | - $this->reportable(function (Throwable $e) { |
|
| 37 | + $this->reportable(function(Throwable $e) { |
|
| 38 | 38 | // |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $settings = Setting::pluck('value', 'key')->toArray(); |
| 44 | 44 | |
| 45 | 45 | if (!isset($settings['site_url']) || !isset($settings['username']) || !isset($settings['password'])) { |
| 46 | - return $this->alert('warning', 'Missing WP site settings'); |
|
| 46 | + return $this->alert('warning', 'Missing WP site settings'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $contact = Contact::findOrFail($id); |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | $this->alert('success', 'Data sync successfull'); |
| 56 | 56 | } else { |
| 57 | 57 | $body = json_decode($response->body(), true); |
| 58 | - if(isset($body['message'])) { |
|
| 58 | + if (isset($body['message'])) { |
|
| 59 | 59 | $detail = $body['message']; |
| 60 | 60 | } else { |
| 61 | 61 | $detail = 'Unknown'; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $this->alert('warning', 'Something wrong happened. Please try again. DETAIL: ' . $detail); |
|
| 64 | + $this->alert('warning', 'Something wrong happened. Please try again. DETAIL: '.$detail); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -78,12 +78,12 @@ discard block |
||
| 78 | 78 | private function getBaseUrl($fullUrl) |
| 79 | 79 | { |
| 80 | 80 | $url_info = parse_url($fullUrl); |
| 81 | - return $url_info['scheme'] . '://' . $url_info['host'] . '/wp-json/wlu/v1/'; |
|
| 81 | + return $url_info['scheme'].'://'.$url_info['host'].'/wp-json/wlu/v1/'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function sendHttpRequest($settings, $contact) |
| 85 | 85 | { |
| 86 | - return Http::withBasicAuth($settings['username'], $settings['password'])->post($this->getBaseUrl($settings['site_url']) . 'customers', [ |
|
| 86 | + return Http::withBasicAuth($settings['username'], $settings['password'])->post($this->getBaseUrl($settings['site_url']).'customers', [ |
|
| 87 | 87 | 'name' => $contact->name, |
| 88 | 88 | 'phone' => $contact->phone_number, |
| 89 | 89 | 'email' => $contact->email, |