33 lines
594 B
PHP
33 lines
594 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Position;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class PositionSeeder extends Seeder
|
|
{
|
|
/**
|
|
* @var list<string>
|
|
*/
|
|
private const POSITIONS = [
|
|
'Operator',
|
|
'Mechanic',
|
|
'Electrician',
|
|
'Cleaner',
|
|
'Manager',
|
|
];
|
|
|
|
public function run(): void
|
|
{
|
|
foreach (self::POSITIONS as $positionName) {
|
|
Position::query()->firstOrCreate(
|
|
['name' => $positionName],
|
|
['description' => null],
|
|
);
|
|
}
|
|
}
|
|
}
|