Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Slot;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class SlotSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
// Weekdays: 1 = Monday, 5 = Friday
|
||||
$weekdays = [1, 2, 3, 4, 5];
|
||||
|
||||
// Session times
|
||||
$times = [
|
||||
'09:00:00',
|
||||
'10:00:00',
|
||||
'11:00:00',
|
||||
'14:00:00',
|
||||
'15:00:00',
|
||||
'16:00:00',
|
||||
];
|
||||
|
||||
$slots = [];
|
||||
$now = now();
|
||||
|
||||
foreach ($weekdays as $weekday) {
|
||||
foreach ($times as $time) {
|
||||
$slots[] = [
|
||||
'weekday' => $weekday,
|
||||
'time' => $time,
|
||||
'is_active' => 1,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
DB::table('slots')->insert($slots);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user