34 lines
800 B
PHP
34 lines
800 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Dun;
|
|
use App\Models\PusatMengundi;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends Factory<PusatMengundi>
|
|
*/
|
|
class PusatMengundiFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$dun = Dun::factory()->create();
|
|
|
|
return [
|
|
'election_id' => $dun->election_id,
|
|
'dun_id' => $dun->id,
|
|
'public_uuid' => (string) Str::uuid(),
|
|
'code' => strtoupper(fake()->unique()->bothify('PM###')),
|
|
'name' => 'SK '.fake()->city(),
|
|
'address' => fake()->address(),
|
|
'registration_url' => null,
|
|
'qr_code_path' => null,
|
|
];
|
|
}
|
|
}
|