@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | Button::create(view('conversations.register-customer.reply-customer_data-no')->render())->value('no'), |
90 | 90 | ]); |
91 | 91 | |
92 | - return $this->ask($question, next: function (Answer $answer) use ($customer) { |
|
92 | + return $this->ask($question, next: function(Answer $answer) use ($customer) { |
|
93 | 93 | if (!$answer->isInteractiveMessageReply()) { |
94 | 94 | return; |
95 | 95 | } |
96 | 96 | |
97 | - if (!in_array($value = $answer->getValue(), ['yes', 'no'])) { |
|
97 | + if (!in_array($value = $answer->getValue(), [ 'yes', 'no' ])) { |
|
98 | 98 | return $this->displayCustomerData($customer, $this->fallbackMessage($answer->getText())); |
99 | 99 | } |
100 | 100 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $additionalParameters = $keyboard->toArray() |
138 | 138 | ); |
139 | 139 | |
140 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $customer, $denominations) { |
|
140 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $customer, $denominations) { |
|
141 | 141 | if (!$answer->isInteractiveMessageReply()) { |
142 | 142 | return; |
143 | 143 | } |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | /** @var \App\Models\Order $order */ |
154 | - $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function (Order $order) { |
|
155 | - $this->setUserStorage(['order_code' => $order->code]); |
|
154 | + $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function(Order $order) { |
|
155 | + $this->setUserStorage([ 'order_code' => $order->code ]); |
|
156 | 156 | }); |
157 | 157 | |
158 | 158 | if ($order->isMaximumTotalOrderExceeded()) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * If there is an order's item that has same denomination with the selected one, |
164 | 164 | * then it will be deleted first before customer continue to record item. |
165 | 165 | */ |
166 | - if ($item = $order->items()->whereHas('denomination', function ($query) use ($denomination) { |
|
166 | + if ($item = $order->items()->whereHas('denomination', function($query) use ($denomination) { |
|
167 | 167 | $query->whereKey($denomination->getKey()); |
168 | 168 | })->first('id')) { |
169 | 169 | $item->delete(); |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | $keyboard = Keyboard::create(Keyboard::TYPE_INLINE)->resizeKeyboard(); |
189 | 189 | $unit = Str::lower($denomination->type->label); |
190 | 190 | |
191 | - collect($denomination->range_order_bundle)->chunk(3)->map(function (Collection $quantities) use ($keyboard, $unit) { |
|
192 | - $keyboard->addRow(...$quantities->map(fn ($quantity) => KeyboardButton::create( |
|
191 | + collect($denomination->range_order_bundle)->chunk(3)->map(function(Collection $quantities) use ($keyboard, $unit) { |
|
192 | + $keyboard->addRow(...$quantities->map(fn($quantity) => KeyboardButton::create( |
|
193 | 193 | view('conversations.exchange.reply-bundle_quantity-quantity', compact('quantity'))->render() |
194 | 194 | )->callbackData($quantity))->toArray()); |
195 | 195 | }); |
196 | 196 | |
197 | 197 | $keyboard->addRow( |
198 | 198 | KeyboardButton::create( |
199 | - view('components.conversations.back', ['text' => 'opsi pilih nominal uang'])->render() |
|
199 | + view('components.conversations.back', [ 'text' => 'opsi pilih nominal uang' ])->render() |
|
200 | 200 | )->callbackData('back_to_denomination_option') |
201 | 201 | ); |
202 | 202 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $additionalParameters = $keyboard->toArray() |
206 | 206 | ); |
207 | 207 | |
208 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $order, $denomination) { |
|
208 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $order, $denomination) { |
|
209 | 209 | $this->deleteTelegramMessageFromResponse($response); |
210 | 210 | |
211 | 211 | if ($answer->getValue() === 'back_to_denomination_option') { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $additionalParameters = $keyboard->toArray() |
263 | 263 | ); |
264 | 264 | |
265 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $responseConfirmOrder, $order) { |
|
265 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $responseConfirmOrder, $order) { |
|
266 | 266 | $this->deleteTelegramMessageFromResponse($response); |
267 | 267 | |
268 | 268 | switch ($answer->getValue()) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return null; |
40 | 40 | } |
41 | 41 | |
42 | - return Storage::url(static::IDENTITYCARD_IMAGE_PATH . '/' . $value); |
|
42 | + return Storage::url(static::IDENTITYCARD_IMAGE_PATH.'/'.$value); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -63,6 +63,6 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getWhatsappPhoneUrlAttribute(): string |
65 | 65 | { |
66 | - return 'https://wa.me/' . Str::replaceFirst('+', '', $this->whatsapp_phone->formatE164()); |
|
66 | + return 'https://wa.me/'.Str::replaceFirst('+', '', $this->whatsapp_phone->formatE164()); |
|
67 | 67 | } |
68 | 68 | } |