first
This commit is contained in:
33
database/factories/StaffAssignmentFactory.php
Normal file
33
database/factories/StaffAssignmentFactory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user