Passed
Push — main ( 0c0b0d...09e0a9 )
by Md. Emtiaz
03:21
created
app/Http/Livewire/ContactTable.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.