50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Ecommerce\Product\Order\Shipping\OrderShippingMethod;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class OrderShippingMethodSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$methods = [
|
|
[
|
|
'slug' => 'standart',
|
|
'name' => ['en' => 'Standart', 'tk' => 'Standart', 'ru' => 'Стандарт'],
|
|
'price' => 20,
|
|
'is_active' => true,
|
|
],
|
|
[
|
|
'slug' => 'express',
|
|
'name' => ['en' => 'Express', 'tk' => 'Express', 'ru' => 'Экспресс'],
|
|
'price' => 30,
|
|
'is_active' => true,
|
|
],
|
|
[
|
|
'slug' => 'self_pickup',
|
|
'name' => ['en' => 'Self Pickup', 'tk' => 'Öz-özüňi almak', 'ru' => 'Самовывоз'],
|
|
'price' => 0,
|
|
'is_active' => true,
|
|
],
|
|
[
|
|
'slug' => 'region',
|
|
'name' => ['en' => 'Region', 'tk' => 'Welaýat', 'ru' => 'Регион'],
|
|
'price' => 40,
|
|
'is_active' => true,
|
|
],
|
|
];
|
|
|
|
foreach ($methods as $method) {
|
|
OrderShippingMethod::firstOrCreate(
|
|
['slug' => $method['slug']],
|
|
$method
|
|
);
|
|
}
|
|
}
|
|
}
|