first
This commit is contained in:
31
database/factories/SaluranMengundiFactory.php
Normal file
31
database/factories/SaluranMengundiFactory.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\PusatMengundi;
|
||||
use App\Models\SaluranMengundi;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SaluranMengundi>
|
||||
*/
|
||||
class SaluranMengundiFactory 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,
|
||||
'pusat_mengundi_id' => $pusat->id,
|
||||
'number' => (string) fake()->numberBetween(1, 10),
|
||||
'name' => 'Saluran '.fake()->numberBetween(1, 10),
|
||||
'voter_count' => fake()->numberBetween(250, 750),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user