This commit is contained in:
2025-12-10 13:01:39 +05:00
parent 8c38dd846f
commit 125d619935
3 changed files with 33 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ class CheckoutOrderRequest extends FormRequest
'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 @@ class CheckoutOrderRequest extends FormRequest
'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,

View File

@@ -100,6 +100,9 @@ class Channel extends Resource
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'),

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('channels', function (Blueprint $table) {
$table->string('shipping_price');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('channels', function (Blueprint $table) {
$table->dropColumn('shipping_price');
});
}
};