wip
This commit is contained in:
1 parent
8c38dd846f
commit
125d619935
3 files changed
+33
-1
No files matched your search
@@ -40,6 +40,7 @@ public function rules(): array
|
||||
'customer_address' => ['required', 'string', 'max:255'],
|
||||
|
||||
'shipping_method' => ['required', 'string', 'max:255', Rule::in(array_keys(OrderShipping::values()))],
|
||||
'shipping_price' => ['nullable', 'numeric'],
|
||||
'payment_type_id' => ['required', Rule::in(array_keys(OrderPayment::values()))],
|
||||
|
||||
'notes' => ['nullable', 'string', 'max:255'],
|
||||
@@ -70,7 +71,7 @@ protected function passedValidation(): void
|
||||
'user_id' => auth()->id(),
|
||||
'notes' => $this->notes ?: null,
|
||||
'province_id' => $this->province_id ?: null,
|
||||
'shipping_price' => OrderShipping::priceFor($this->shipping_method),
|
||||
'shipping_price' => $this->shipping_price ?: OrderShipping::priceFor($this->shipping_method),
|
||||
'delivery_time' => $this->delivery_time ?: OrderShipping::MORNING,
|
||||
'delivery_at' => $this->delivery_at ?: date('Y-m-d'),
|
||||
'source_app' => $this->source ?: OS::MOBILE_APP,
|
||||
|
||||
@@ -100,6 +100,9 @@ public function fields(NovaRequest $request): array
|
||||
Text::make(__('Description'), 'description')
|
||||
->rules(['nullable', 'string', 'max:255']),
|
||||
|
||||
Text::make('Daswtawka bahasy', 'shipping_price')
|
||||
->rules('nullable', 'numeric'),
|
||||
|
||||
URL::make('URL'),
|
||||
Hidden::make('is_default')->default(true),
|
||||
Hidden::make('timezone')->default('Asia/Ashgabat'),
|
||||
|
||||
Reference in new issue
Block a user