base commit

This commit is contained in:
Mekan1206
2026-07-30 17:24:40 +05:00
commit a794dacd39
345 changed files with 29597 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
namespace Database\Seeders;
use App\Models\Shift;
use Illuminate\Database\Seeder;
class ShiftSeeder extends Seeder
{
/**
* @var array<string, array{name: string, starts_at: string, ends_at: string}>
*/
private const SHIFTS = [
'A' => [
'name' => 'Shift A',
'starts_at' => '06:00:00',
'ends_at' => '14:00:00',
],
'B' => [
'name' => 'Shift B',
'starts_at' => '14:00:00',
'ends_at' => '22:00:00',
],
'C' => [
'name' => 'Shift C',
'starts_at' => '22:00:00',
'ends_at' => '06:00:00',
],
'Night' => [
'name' => 'Night Shift',
'starts_at' => '22:00:00',
'ends_at' => '06:00:00',
],
];
public function run(): void
{
foreach (self::SHIFTS as $code => $shift) {
Shift::query()->updateOrCreate(
['code' => $code],
[
'name' => $shift['name'],
'starts_at' => $shift['starts_at'],
'ends_at' => $shift['ends_at'],
'description' => null,
'is_active' => true,
],
);
}
}
}