base commit
This commit is contained in:
32
database/seeders/PositionSeeder.php
Normal file
32
database/seeders/PositionSeeder.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user