34 lines
758 B
PHP
34 lines
758 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Position;
|
|
use App\Models\PusatMengundi;
|
|
use App\Models\StaffAssignment;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<StaffAssignment>
|
|
*/
|
|
class StaffAssignmentFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$pusat = PusatMengundi::factory()->create();
|
|
|
|
return [
|
|
'election_id' => $pusat->election_id,
|
|
'position_id' => Position::factory(),
|
|
'pusat_mengundi_id' => $pusat->id,
|
|
'status' => 'active',
|
|
'assigned_at' => now(),
|
|
'source' => 'factory',
|
|
];
|
|
}
|
|
}
|