135 lines
4.6 KiB
PHP
135 lines
4.6 KiB
PHP
<?php
|
|
|
|
namespace Modules\RestaurantDelivery\Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Str;
|
|
|
|
class RestaurantDeliveryZoneSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$zones = [
|
|
[
|
|
'restaurant_id' => 1,
|
|
'uuid' => Str::uuid(),
|
|
'name' => 'Dhanmondi Zone',
|
|
'slug' => 'dhanmondi-zone',
|
|
'description' => 'Delivery zone covering Dhanmondi area',
|
|
'color' => '#3B82F6',
|
|
'coordinates' => json_encode([
|
|
[23.7461, 90.3742],
|
|
[23.7485, 90.3810],
|
|
[23.7428, 90.3852],
|
|
[23.7395, 90.3770],
|
|
[23.7461, 90.3742],
|
|
]),
|
|
'min_lat' => 23.7395,
|
|
'max_lat' => 23.7485,
|
|
'min_lng' => 90.3742,
|
|
'max_lng' => 90.3852,
|
|
'priority' => 1,
|
|
'is_active' => true,
|
|
'is_default' => true,
|
|
'max_delivery_distance' => 5.00,
|
|
'operating_hours' => json_encode([
|
|
'open' => '10:00',
|
|
'close' => '23:00',
|
|
]),
|
|
],
|
|
[
|
|
'restaurant_id' => 1,
|
|
'uuid' => Str::uuid(),
|
|
'name' => 'Gulshan Zone',
|
|
'slug' => 'gulshan-zone',
|
|
'description' => 'Delivery zone covering Gulshan area',
|
|
'color' => '#22C55E',
|
|
'coordinates' => json_encode([
|
|
[23.7930, 90.4043],
|
|
[23.7965, 90.4108],
|
|
[23.7892, 90.4151],
|
|
[23.7850, 90.4082],
|
|
[23.7930, 90.4043],
|
|
]),
|
|
'min_lat' => 23.7850,
|
|
'max_lat' => 23.7965,
|
|
'min_lng' => 90.4043,
|
|
'max_lng' => 90.4151,
|
|
'priority' => 2,
|
|
'is_active' => true,
|
|
'is_default' => false,
|
|
'max_delivery_distance' => 6.00,
|
|
'operating_hours' => json_encode([
|
|
'open' => '09:00',
|
|
'close' => '22:30',
|
|
]),
|
|
],
|
|
[
|
|
'restaurant_id' => 1,
|
|
'uuid' => Str::uuid(),
|
|
'name' => 'Mirpur Zone',
|
|
'slug' => 'mirpur-zone',
|
|
'description' => 'Delivery zone covering Mirpur area',
|
|
'color' => '#F97316',
|
|
'coordinates' => json_encode([
|
|
[23.8223, 90.3654],
|
|
[23.8280, 90.3725],
|
|
[23.8190, 90.3780],
|
|
[23.8135, 90.3698],
|
|
[23.8223, 90.3654],
|
|
]),
|
|
'min_lat' => 23.8135,
|
|
'max_lat' => 23.8280,
|
|
'min_lng' => 90.3654,
|
|
'max_lng' => 90.3780,
|
|
'priority' => 3,
|
|
'is_active' => true,
|
|
'is_default' => false,
|
|
'max_delivery_distance' => 7.00,
|
|
'operating_hours' => json_encode([
|
|
'open' => '10:00',
|
|
'close' => '22:00',
|
|
]),
|
|
],
|
|
[
|
|
'restaurant_id' => 1,
|
|
'uuid' => Str::uuid(),
|
|
'name' => 'Uttara Zone',
|
|
'slug' => 'uttara-zone',
|
|
'description' => 'Delivery zone covering Uttara area',
|
|
'color' => '#A855F7',
|
|
'coordinates' => json_encode([
|
|
[23.8759, 90.3795],
|
|
[23.8812, 90.3878],
|
|
[23.8720, 90.3932],
|
|
[23.8671, 90.3841],
|
|
[23.8759, 90.3795],
|
|
]),
|
|
'min_lat' => 23.8671,
|
|
'max_lat' => 23.8812,
|
|
'min_lng' => 90.3795,
|
|
'max_lng' => 90.3932,
|
|
'priority' => 4,
|
|
'is_active' => true,
|
|
'is_default' => false,
|
|
'max_delivery_distance' => 8.00,
|
|
'operating_hours' => json_encode([
|
|
'open' => '09:30',
|
|
'close' => '23:30',
|
|
]),
|
|
],
|
|
];
|
|
|
|
foreach ($zones as $zone) {
|
|
DB::table('restaurant_delivery_zones')->insert(array_merge($zone, [
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]));
|
|
}
|
|
}
|
|
}
|