39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Restaurant\Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Modules\Restaurant\Models\Table;
|
|
|
|
class TableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$sections = ['Main Hall', 'VIP Area', 'Outdoor'];
|
|
$tableTypes = ['regular', 'vip', 'outdoor', 'booth'];
|
|
|
|
foreach (range(1, 10) as $num) {
|
|
Table::create([
|
|
'restaurant_id' => 1,
|
|
'name' => 'T'.str_pad($num, 2, '0', STR_PAD_LEFT),
|
|
'serial' => 'T'.str_pad($num, 2, '0', STR_PAD_LEFT),
|
|
'location' => 'Floor 1',
|
|
'section' => $sections[array_rand($sections)],
|
|
'table_type' => $tableTypes[array_rand($tableTypes)],
|
|
'capacity' => rand(2, 6),
|
|
'is_bookable' => true,
|
|
'qr_code' => 'QR'.str_pad($num, 2, '0', STR_PAD_LEFT),
|
|
'image' => null,
|
|
'position_x' => rand(50, 500),
|
|
'position_y' => rand(50, 500),
|
|
'rotation' => rand(0, 360),
|
|
'z_index' => rand(1, 10),
|
|
'status' => 1,
|
|
]);
|
|
}
|
|
}
|
|
}
|