@@ -44,35 +44,3 @@ |
||
44 | 44 | public function getIsActiveBadgeAttribute(): string |
45 | 45 | { |
46 | 46 | return sprintf(<<<'html' |
47 | - <span class="badge badge-%s"> |
|
48 | - <i class="fa fa-%s"></i> %s |
|
49 | - </span> |
|
50 | - html, |
|
51 | - $this->is_active ? 'success' : 'danger', |
|
52 | - $this->is_active ? 'check-circle' : 'times-circle', |
|
53 | - $this->is_active ? trans('Active') : trans('Not Active') |
|
54 | - ); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Return "role" attribute value. |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function getRoleAttribute(): string |
|
63 | - { |
|
64 | - $this->load('roles:id,name'); |
|
65 | - |
|
66 | - return $this->roles->first()->name; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Return "gravatar_image" attribute value. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getGravatarImageAttribute(): string |
|
75 | - { |
|
76 | - return gravatar_image($this->email); |
|
77 | - } |
|
78 | -} |
@@ -44,35 +44,3 @@ |
||
44 | 44 | public function getIsActiveBadgeAttribute(): string |
45 | 45 | { |
46 | 46 | return sprintf(<<<'html' |
47 | - <span class="badge badge-%s"> |
|
48 | - <i class="fa fa-%s"></i> %s |
|
49 | - </span> |
|
50 | - html, |
|
51 | - $this->is_active ? 'success' : 'danger', |
|
52 | - $this->is_active ? 'check-circle' : 'times-circle', |
|
53 | - $this->is_active ? trans('Active') : trans('Not Active') |
|
54 | - ); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Return "role" attribute value. |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function getRoleAttribute(): string |
|
63 | - { |
|
64 | - $this->load('roles:id,name'); |
|
65 | - |
|
66 | - return $this->roles->first()->name; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Return "gravatar_image" attribute value. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getGravatarImageAttribute(): string |
|
75 | - { |
|
76 | - return gravatar_image($this->email); |
|
77 | - } |
|
78 | -} |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function setPasswordAttribute($value) |
33 | 33 | { |
34 | - $this->attributes['password'] = Hash::make($value); |
|
34 | + $this->attributes[ 'password' ] = Hash::make($value); |
|
35 | 35 | |
36 | 36 | return $this; |
37 | 37 | } |
@@ -44,35 +44,3 @@ discard block |
||
44 | 44 | public function getIsActiveBadgeAttribute(): string |
45 | 45 | { |
46 | 46 | return sprintf(<<<'html' |
47 | - <span class="badge badge-%s"> |
|
48 | - <i class="fa fa-%s"></i> %s |
|
49 | - </span> |
|
50 | - html, |
|
51 | - $this->is_active ? 'success' : 'danger', |
|
52 | - $this->is_active ? 'check-circle' : 'times-circle', |
|
53 | - $this->is_active ? trans('Active') : trans('Not Active') |
|
54 | - ); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Return "role" attribute value. |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function getRoleAttribute(): string |
|
63 | - { |
|
64 | - $this->load('roles:id,name'); |
|
65 | - |
|
66 | - return $this->roles->first()->name; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Return "gravatar_image" attribute value. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getGravatarImageAttribute(): string |
|
75 | - { |
|
76 | - return gravatar_image($this->email); |
|
77 | - } |
|
78 | -} |
@@ -44,35 +44,3 @@ |
||
44 | 44 | public function getIsActiveBadgeAttribute(): string |
45 | 45 | { |
46 | 46 | return sprintf(<<<'html' |
47 | - <span class="badge badge-%s"> |
|
48 | - <i class="fa fa-%s"></i> %s |
|
49 | - </span> |
|
50 | - html, |
|
51 | - $this->is_active ? 'success' : 'danger', |
|
52 | - $this->is_active ? 'check-circle' : 'times-circle', |
|
53 | - $this->is_active ? trans('Active') : trans('Not Active') |
|
54 | - ); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Return "role" attribute value. |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function getRoleAttribute(): string |
|
63 | - { |
|
64 | - $this->load('roles:id,name'); |
|
65 | - |
|
66 | - return $this->roles->first()->name; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Return "gravatar_image" attribute value. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getGravatarImageAttribute(): string |
|
75 | - { |
|
76 | - return gravatar_image($this->email); |
|
77 | - } |
|
78 | -} |
@@ -44,35 +44,3 @@ |
||
44 | 44 | public function getIsActiveBadgeAttribute(): string |
45 | 45 | { |
46 | 46 | return sprintf(<<<'html' |
47 | - <span class="badge badge-%s"> |
|
48 | - <i class="fa fa-%s"></i> %s |
|
49 | - </span> |
|
50 | - html, |
|
51 | - $this->is_active ? 'success' : 'danger', |
|
52 | - $this->is_active ? 'check-circle' : 'times-circle', |
|
53 | - $this->is_active ? trans('Active') : trans('Not Active') |
|
54 | - ); |
|
55 | - } |
|
56 | - |
|
57 | - /** |
|
58 | - * Return "role" attribute value. |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function getRoleAttribute(): string |
|
63 | - { |
|
64 | - $this->load('roles:id,name'); |
|
65 | - |
|
66 | - return $this->roles->first()->name; |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Return "gravatar_image" attribute value. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getGravatarImageAttribute(): string |
|
75 | - { |
|
76 | - return gravatar_image($this->email); |
|
77 | - } |
|
78 | -} |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function run() |
16 | 16 | { |
17 | - array_map(fn (array $attributes) => Configuration::create($attributes), [ |
|
17 | + array_map(fn(array $attributes) => Configuration::create($attributes), [ |
|
18 | 18 | [ |
19 | 19 | 'key' => 'maximum_total_order_value', |
20 | 20 | 'value' => null, |
@@ -17,13 +17,13 @@ |
||
17 | 17 | */ |
18 | 18 | public function up() |
19 | 19 | { |
20 | - Schema::create('denominations', function (Blueprint $table) { |
|
20 | + Schema::create('denominations', function(Blueprint $table) { |
|
21 | 21 | $table->id(); |
22 | 22 | |
23 | 23 | $table->string('code')->unique(); |
24 | 24 | $table->string('name'); |
25 | 25 | $table->unsignedDecimal('value'); |
26 | - $table->string('type')->comment('Enum of ' . DenominationType::class); |
|
26 | + $table->string('type')->comment('Enum of '.DenominationType::class); |
|
27 | 27 | $table->unsignedInteger('quantity_per_bundle'); |
28 | 28 | $table->unsignedInteger('minimum_order_bundle'); |
29 | 29 | $table->unsignedInteger('maximum_order_bundle'); |
@@ -29,22 +29,22 @@ |
||
29 | 29 | $type = $isCoin ? DenominationType::coin() : DenominationType::banknote(); |
30 | 30 | |
31 | 31 | $value = $isCoin |
32 | - ? $this->faker->randomElement([100, 200, 500, 1000]) |
|
33 | - : $this->faker->randomElement([1000, 2000, 5000, 10000, 20000, 50000, 75000, 100000]); |
|
32 | + ? $this->faker->randomElement([ 100, 200, 500, 1000 ]) |
|
33 | + : $this->faker->randomElement([ 1000, 2000, 5000, 10000, 20000, 50000, 75000, 100000 ]); |
|
34 | 34 | |
35 | 35 | return [ |
36 | - 'code' => $type->value . '-' . $value, |
|
36 | + 'code' => $type->value.'-'.$value, |
|
37 | 37 | 'name' => terbilang($value), |
38 | 38 | 'value' => $value, |
39 | 39 | 'type' => $type, |
40 | - 'quantity_per_bundle' => $this->faker->randomElement([50, 100, 200]), |
|
40 | + 'quantity_per_bundle' => $this->faker->randomElement([ 50, 100, 200 ]), |
|
41 | 41 | 'minimum_order_bundle' => $minimumBundle = $this->faker->numberBetween(1, 10), |
42 | 42 | 'maximum_order_bundle' => $this->faker->numberBetween($minimumBundle, 10), |
43 | 43 | 'minimum_order_quantity' => $canOrderCustomQuantity ? $minimumQuantity = $this->faker->numberBetween(1, 100) : null, |
44 | 44 | 'maximum_order_quantity' => $canOrderCustomQuantity ? $this->faker->numberBetween($minimumQuantity, 100) : null, |
45 | 45 | 'can_order_custom_quantity' => $canOrderCustomQuantity, |
46 | 46 | 'is_visible' => $this->faker->boolean, |
47 | - 'image' => UploadedFile::fake()->image($type->value . '-' . $value . '.jpg'), |
|
47 | + 'image' => UploadedFile::fake()->image($type->value.'-'.$value.'.jpg'), |
|
48 | 48 | ]; |
49 | 49 | } |
50 | 50 | } |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | public function rules() |
16 | 16 | { |
17 | 17 | return [ |
18 | - 'code' => ['required', 'string', 'max:255', Rule::unique(Denomination::class)->ignoreModel($this->route('denomination'))], |
|
18 | + 'code' => [ 'required', 'string', 'max:255', Rule::unique(Denomination::class)->ignoreModel($this->route('denomination')) ], |
|
19 | 19 | 'name' => 'required|string|max:255', |
20 | 20 | 'value' => 'required|numeric|min:0', |
21 | - 'type' => 'required|enum:' . DenominationType::class, |
|
21 | + 'type' => 'required|enum:'.DenominationType::class, |
|
22 | 22 | 'quantity_per_bundle' => 'required|numeric|min:0', |
23 | 23 | 'minimum_order_bundle' => 'required|numeric|min:0', |
24 | 24 | 'maximum_order_bundle' => 'required|numeric|gte:minimum_order_bundle', |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | $model = $this->route('denomination'); |
47 | 47 | |
48 | 48 | if ($model->getRawOriginal('image') && $this->hasFile($key)) { |
49 | - Storage::delete(Denomination::IMAGE_PATH . '/' . $model->getRawOriginal('image')); |
|
49 | + Storage::delete(Denomination::IMAGE_PATH.'/'.$model->getRawOriginal('image')); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $file = $this->file($key); |
53 | 53 | |
54 | 54 | $file->storeAs( |
55 | 55 | Denomination::IMAGE_PATH, |
56 | - $filename = ($this->input('type') . '-' . $this->input('value') . '.' . $file->getClientOriginalExtension()) |
|
56 | + $filename = ($this->input('type').'-'.$this->input('value').'.'.$file->getClientOriginalExtension()) |
|
57 | 57 | ); |
58 | 58 | |
59 | 59 | return $filename; |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | public function rules() |
14 | 14 | { |
15 | 15 | return [ |
16 | - 'code' => 'required|string|max:255|unique:' . Denomination::class, |
|
16 | + 'code' => 'required|string|max:255|unique:'.Denomination::class, |
|
17 | 17 | 'name' => 'required|string|max:255', |
18 | 18 | 'value' => 'required|numeric|min:0', |
19 | - 'type' => 'required|enum:' . DenominationType::class, |
|
19 | + 'type' => 'required|enum:'.DenominationType::class, |
|
20 | 20 | 'quantity_per_bundle' => 'required|numeric|min:0', |
21 | 21 | 'minimum_order_bundle' => 'required|numeric|min:0', |
22 | 22 | 'maximum_order_bundle' => 'required|numeric|gte:minimum_order_bundle', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $file->storeAs( |
46 | 46 | Denomination::IMAGE_PATH, |
47 | - $filename = ($this->input('type') . '-' . $this->input('value') . '.' . $file->getClientOriginalExtension()) |
|
47 | + $filename = ($this->input('type').'-'.$this->input('value').'.'.$file->getClientOriginalExtension()) |
|
48 | 48 | ); |
49 | 49 | |
50 | 50 | return $filename; |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | Button::create(view('conversations.register-customer.reply-customer_data-no')->render())->value('no'), |
89 | 89 | ]); |
90 | 90 | |
91 | - return $this->ask($question, next: function (Answer $answer) use ($customer) { |
|
91 | + return $this->ask($question, next: function(Answer $answer) use ($customer) { |
|
92 | 92 | if (!$answer->isInteractiveMessageReply()) { |
93 | 93 | return; |
94 | 94 | } |
95 | 95 | |
96 | - if (!in_array($value = $answer->getValue(), ['yes', 'no'])) { |
|
96 | + if (!in_array($value = $answer->getValue(), [ 'yes', 'no' ])) { |
|
97 | 97 | return $this->displayCustomerData($customer, $this->fallbackMessage($answer->getText())); |
98 | 98 | } |
99 | 99 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $this->displayValidationErrorMessage($validationErrorMessage); |
122 | 122 | |
123 | - $denominations = Denomination::whereIsVisible()->get(['id', 'code', 'name', 'value']); |
|
123 | + $denominations = Denomination::whereIsVisible()->get([ 'id', 'code', 'name', 'value' ]); |
|
124 | 124 | $keyboard = Keyboard::create(Keyboard::TYPE_INLINE)->resizeKeyboard(); |
125 | 125 | |
126 | 126 | foreach ($denominations as $denomination) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $additionalParameters = $keyboard->toArray() |
137 | 137 | ); |
138 | 138 | |
139 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $customer, $denominations) { |
|
139 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $customer, $denominations) { |
|
140 | 140 | if (!$answer->isInteractiveMessageReply()) { |
141 | 141 | return; |
142 | 142 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | /** @var \App\Models\Order $order */ |
152 | - $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function (Order $order) { |
|
153 | - $this->setUserStorage(['order_code' => $order->code]); |
|
152 | + $order = Order::findOrCreateFromCode($this->getUserStorage('order_code'), $customer, function(Order $order) { |
|
153 | + $this->setUserStorage([ 'order_code' => $order->code ]); |
|
154 | 154 | }); |
155 | 155 | |
156 | 156 | if ($order->isMaximumTotalOrderExceeded()) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $additionalParameters = $keyboard->toArray() |
212 | 212 | ); |
213 | 213 | |
214 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $order, $denomination, $branches) { |
|
214 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $order, $denomination, $branches) { |
|
215 | 215 | if (!$answer->isInteractiveMessageReply()) { |
216 | 216 | return; |
217 | 217 | } |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | $keyboard = Keyboard::create(Keyboard::TYPE_INLINE)->resizeKeyboard(); |
247 | 247 | $unit = Str::lower($denomination->type->label); |
248 | 248 | |
249 | - collect($denomination->range_order_bundle)->chunk(3)->map(function (Collection $quantities) use ($keyboard, $unit) { |
|
250 | - $keyboard->addRow(...$quantities->map(fn ($quantity) => KeyboardButton::create( |
|
249 | + collect($denomination->range_order_bundle)->chunk(3)->map(function(Collection $quantities) use ($keyboard, $unit) { |
|
250 | + $keyboard->addRow(...$quantities->map(fn($quantity) => KeyboardButton::create( |
|
251 | 251 | view('conversations.exchange.reply-bundle_quantity-quantity', compact('quantity'))->render() |
252 | 252 | )->callbackData($quantity))->toArray()); |
253 | 253 | }); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | $additionalParameters = $keyboard->toArray() |
264 | 264 | ); |
265 | 265 | |
266 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $order, $denomination) { |
|
266 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $order, $denomination) { |
|
267 | 267 | $this->deleteTelegramMessageFromResponse($response); |
268 | 268 | |
269 | 269 | if ($answer->getValue() === 'bundle_quantity_custom') { |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | ->resizeKeyboard() |
276 | 276 | ->oneTimeKeyboard() |
277 | 277 | ->addRow(KeyboardButton::create( |
278 | - $backToDenominationOption = trim(view('components.conversations.back', ['text' => 'opsi nominal'])->render()) |
|
278 | + $backToDenominationOption = trim(view('components.conversations.back', [ 'text' => 'opsi nominal' ])->render()) |
|
279 | 279 | )->callbackData('back_to_denomination_option'))->toArray() |
280 | 280 | ); |
281 | 281 | |
282 | - return $this->getBot()->storeConversation($this, function (Answer $answer) use ($response2, $order, $denomination, $backToDenominationOption) { |
|
282 | + return $this->getBot()->storeConversation($this, function(Answer $answer) use ($response2, $order, $denomination, $backToDenominationOption) { |
|
283 | 283 | $this->deleteTelegramMessageFromResponse($response2); |
284 | 284 | |
285 | 285 | if ($answer->getText() === $backToDenominationOption) { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | $additionalParameters = $keyboard->toArray() |
354 | 354 | ); |
355 | 355 | |
356 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response, $responseConfirmOrder, $order) { |
|
356 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response, $responseConfirmOrder, $order) { |
|
357 | 357 | $this->deleteTelegramMessageFromResponse($response); |
358 | 358 | |
359 | 359 | switch ($answer->getValue()) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $this->displayValidationErrorMessage($validationErrorMessage); |
36 | 36 | |
37 | - return $this->askRenderable('conversations.exchange.ask-email', function (Answer $answer) { |
|
37 | + return $this->askRenderable('conversations.exchange.ask-email', function(Answer $answer) { |
|
38 | 38 | $value = $answer->getText(); |
39 | 39 | $validator = CustomerStoreRequest::createValidator($value, 'email'); |
40 | 40 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return $this->askEmail($validator->errors()->first('email')); |
43 | 43 | } |
44 | 44 | |
45 | - $this->setUserStorage(['email' => $email = $validator->validated()['email']]); |
|
45 | + $this->setUserStorage([ 'email' => $email = $validator->validated()[ 'email' ] ]); |
|
46 | 46 | |
47 | 47 | $username = $this->getUser()->getUsername(); |
48 | 48 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->displayValidationErrorMessage($validationErrorMessage); |
66 | 66 | |
67 | - return $this->askRenderable('conversations.register-customer.ask-fullname', function (Answer $answer) { |
|
67 | + return $this->askRenderable('conversations.register-customer.ask-fullname', function(Answer $answer) { |
|
68 | 68 | $value = $answer->getText(); |
69 | 69 | $validator = CustomerStoreRequest::createValidator($value, 'fullname'); |
70 | 70 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | return $this->askFullName($validator->errors()->first('fullname')); |
73 | 73 | } |
74 | 74 | |
75 | - $this->setUserStorage(['fullname' => $validator->validated()['fullname']]); |
|
75 | + $this->setUserStorage([ 'fullname' => $validator->validated()[ 'fullname' ] ]); |
|
76 | 76 | |
77 | 77 | return $this->askIdentityNumberOption(); |
78 | 78 | }); |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | Button::create(view('conversations.register-customer.reply-identity_number-no')->render())->value('no'), |
102 | 102 | ]); |
103 | 103 | |
104 | - return $this->ask($question, function (Answer $answer) { |
|
104 | + return $this->ask($question, function(Answer $answer) { |
|
105 | 105 | if (!$answer->isInteractiveMessageReply()) { |
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
109 | - if (!in_array($value = $answer->getValue(), ['yes', 'no'])) { |
|
109 | + if (!in_array($value = $answer->getValue(), [ 'yes', 'no' ])) { |
|
110 | 110 | return $this->askIdentityNumberOption($this->fallbackMessage($answer->getText())); |
111 | 111 | } |
112 | 112 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function backToIdentityNumberOption(): string |
125 | 125 | { |
126 | - return trim(view('components.conversations.back', ['text' => 'opsi rekening/KTP'])->render()); |
|
126 | + return trim(view('components.conversations.back', [ 'text' => 'opsi rekening/KTP' ])->render()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $additionalParameters = $this->keyboardBackToIdentityNumberOption()->toArray() |
154 | 154 | ); |
155 | 155 | |
156 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response) { |
|
156 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response) { |
|
157 | 157 | if (trim($answer->getText()) === $this->backToIdentityNumberOption()) { |
158 | 158 | $this->deleteTelegramMessageFromResponse($response); |
159 | 159 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | return $this->askAccountNumber($validator->errors()->first('account_number')); |
168 | 168 | } |
169 | 169 | |
170 | - $this->setUserStorage(['account_number' => $validator->validated()['account_number']]); |
|
170 | + $this->setUserStorage([ 'account_number' => $validator->validated()[ 'account_number' ] ]); |
|
171 | 171 | |
172 | 172 | return $this->askPhone(); |
173 | 173 | }, question: $question, additionalParameters: $additionalParameters); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $additionalParameters = $this->keyboardBackToIdentityNumberOption()->toArray() |
189 | 189 | ); |
190 | 190 | |
191 | - return $this->getBot()->storeConversation($this, next: function (Answer $answer) use ($response) { |
|
191 | + return $this->getBot()->storeConversation($this, next: function(Answer $answer) use ($response) { |
|
192 | 192 | if (trim($answer->getText()) === $this->backToIdentityNumberOption()) { |
193 | 193 | $this->deleteTelegramMessageFromResponse($response); |
194 | 194 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | return $this->askIdentityCard($validator->errors()->first('identitycard_number')); |
203 | 203 | } |
204 | 204 | |
205 | - $this->setUserStorage(['identitycard_number' => $validator->validated()['identitycard_number']]); |
|
205 | + $this->setUserStorage([ 'identitycard_number' => $validator->validated()[ 'identitycard_number' ] ]); |
|
206 | 206 | |
207 | 207 | return $this->askPhone(); |
208 | 208 | }, question: $question, additionalParameters: $additionalParameters); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | { |
219 | 219 | $this->displayValidationErrorMessage($validationErrorMessage); |
220 | 220 | |
221 | - return $this->askRenderable('conversations.register-customer.ask-phone', function () { |
|
221 | + return $this->askRenderable('conversations.register-customer.ask-phone', function() { |
|
222 | 222 | $value = $this->getMessagePayload('contact.phone_number'); |
223 | 223 | $validator = CustomerStoreRequest::createValidator($value, 'phone'); |
224 | 224 | |
@@ -226,15 +226,15 @@ discard block |
||
226 | 226 | return $this->askPhone($validator->errors()->first('phone')); |
227 | 227 | } |
228 | 228 | |
229 | - $this->setUserStorage(['phone' => $validator->validated()['phone']]); |
|
229 | + $this->setUserStorage([ 'phone' => $validator->validated()[ 'phone' ] ]); |
|
230 | 230 | |
231 | 231 | return $this->askWhatsappPhone(); |
232 | - }, additionalParameters: ['reply_markup' => json_encode([ |
|
233 | - 'keyboard' => [[['text' => '☎️ ' . trans('Send My Phone Number'), 'request_contact' => true]]], |
|
232 | + }, additionalParameters: [ 'reply_markup' => json_encode([ |
|
233 | + 'keyboard' => [ [ [ 'text' => '☎️ '.trans('Send My Phone Number'), 'request_contact' => true ] ] ], |
|
234 | 234 | 'resize_keyboard' => true, |
235 | 235 | 'one_time_keyboard' => true, |
236 | 236 | 'remove_keyboard' => true, |
237 | - ])]); |
|
237 | + ]) ]); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -247,34 +247,34 @@ discard block |
||
247 | 247 | { |
248 | 248 | $this->displayValidationErrorMessage($validationErrorMessage); |
249 | 249 | |
250 | - $question = Question::create(view('conversations.register-customer.confirm-whatsapp_phone', ['phone' => $this->getUserStorage('phone')])->render()) |
|
250 | + $question = Question::create(view('conversations.register-customer.confirm-whatsapp_phone', [ 'phone' => $this->getUserStorage('phone') ])->render()) |
|
251 | 251 | ->callbackId('register_confirm_whatsapp_phone') |
252 | 252 | ->addButtons([ |
253 | 253 | Button::create(view('conversations.register-customer.reply-whatsapp_phone-yes')->render())->value('yes'), |
254 | 254 | Button::create(view('conversations.register-customer.reply-whatsapp_phone-no')->render())->value('no'), |
255 | 255 | ]); |
256 | 256 | |
257 | - return $this->ask($question, function (Answer $answer) { |
|
257 | + return $this->ask($question, function(Answer $answer) { |
|
258 | 258 | if (!$answer->isInteractiveMessageReply()) { |
259 | 259 | return; |
260 | 260 | } |
261 | 261 | |
262 | - if (!in_array($value = $answer->getValue(), ['yes', 'no'])) { |
|
262 | + if (!in_array($value = $answer->getValue(), [ 'yes', 'no' ])) { |
|
263 | 263 | return $this->askWhatsappPhone($this->fallbackMessage($answer->getText())); |
264 | 264 | } |
265 | 265 | |
266 | 266 | $phone = $this->getUserStorage('phone'); |
267 | 267 | |
268 | 268 | if ($value === 'yes') { |
269 | - $this->setUserStorage(['whatsapp_phone' => $phone]); |
|
269 | + $this->setUserStorage([ 'whatsapp_phone' => $phone ]); |
|
270 | 270 | |
271 | 271 | return $this->askLocation(); |
272 | 272 | } |
273 | 273 | |
274 | - return value(function (string $validationErrorMessage = null) use (&$callback) { |
|
274 | + return value(function(string $validationErrorMessage = null) use (&$callback) { |
|
275 | 275 | $this->displayValidationErrorMessage($validationErrorMessage); |
276 | 276 | |
277 | - $this->askRenderable('conversations.register-customer.ask-whatsapp_phone', function (Answer $answer) use (&$phone, $callback) { |
|
277 | + $this->askRenderable('conversations.register-customer.ask-whatsapp_phone', function(Answer $answer) use (&$phone, $callback) { |
|
278 | 278 | $value = $answer->getText(); |
279 | 279 | $validator = CustomerStoreRequest::createValidator($value, 'whatsapp_phone'); |
280 | 280 | |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | return $callback($validator->errors()->first('whatsapp_phone')); |
283 | 283 | } |
284 | 284 | |
285 | - $phone = $validator->validated()['whatsapp_phone']; |
|
285 | + $phone = $validator->validated()[ 'whatsapp_phone' ]; |
|
286 | 286 | |
287 | - $this->setUserStorage(['whatsapp_phone' => $phone]); |
|
287 | + $this->setUserStorage([ 'whatsapp_phone' => $phone ]); |
|
288 | 288 | |
289 | 289 | return $this->askLocation(); |
290 | 290 | }); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | $this->displayValidationErrorMessage($validationErrorMessage); |
304 | 304 | |
305 | - return $this->askRenderable('conversations.register-customer.ask-location', function () { |
|
305 | + return $this->askRenderable('conversations.register-customer.ask-location', function() { |
|
306 | 306 | $latitude = $this->getMessagePayload('location.latitude'); |
307 | 307 | $longitude = $this->getMessagePayload('location.longitude'); |
308 | 308 | |
@@ -323,11 +323,11 @@ discard block |
||
323 | 323 | ]); |
324 | 324 | |
325 | 325 | return $this->askDataConfirmation(); |
326 | - }, additionalParameters: ['reply_markup' => json_encode([ |
|
327 | - 'keyboard' => [[['text' => ' |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | break; |
70 | 70 | |
71 | 71 | case EnumOrderStatus::scheduled(): |
72 | - $title = trans('Create :name', ['name' => __('Schedule Date')]); |
|
72 | + $title = trans('Create :name', [ 'name' => __('Schedule Date') ]); |
|
73 | 73 | break; |
74 | 74 | |
75 | 75 | case EnumOrderStatus::rescheduled(): |
76 | - $title = trans('Create :name', ['name' => __('Reschedule Date')]); |
|
76 | + $title = trans('Create :name', [ 'name' => __('Reschedule Date') ]); |
|
77 | 77 | break; |
78 | 78 | |
79 | 79 | case EnumOrderStatus::canceled(): |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | |
90 | 90 | $url = route('admin.order.status.create', compact('order', 'enumOrderStatus')); |
91 | 91 | |
92 | - $optionUsers = User::when($order->branch, function (Builder $query) use ($order) { |
|
93 | - $query->whereHas('branch', function (Builder $query) use ($order) { |
|
92 | + $optionUsers = User::when($order->branch, function(Builder $query) use ($order) { |
|
93 | + $query->whereHas('branch', function(Builder $query) use ($order) { |
|
94 | 94 | $query->whereKey($order->branch->getKey()); |
95 | 95 | }); |
96 | 96 | })->pluck('fullname', 'id'); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return redirect()->route('admin.order.show', $order)->with([ |
131 | 131 | 'alert' => [ |
132 | 132 | 'type' => 'alert-success', |
133 | - 'message' => trans('The :resource was updated!', ['resource' => trans('admin-lang.order')]), |
|
133 | + 'message' => trans('The :resource was updated!', [ 'resource' => trans('admin-lang.order') ]), |
|
134 | 134 | ], |
135 | 135 | ]); |
136 | 136 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | return redirect()->route('admin.order.show', $order)->with([ |
160 | 160 | 'alert' => [ |
161 | 161 | 'type' => 'alert-success', |
162 | - 'message' => trans('The :resource was deleted!', ['resource' => trans('Order Status')]), |
|
162 | + 'message' => trans('The :resource was deleted!', [ 'resource' => trans('Order Status') ]), |
|
163 | 163 | ], |
164 | 164 | ]); |
165 | 165 | } |