first
This commit is contained in:
32
database/factories/ElectionFactory.php
Normal file
32
database/factories/ElectionFactory.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Election;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Election>
|
||||
*/
|
||||
class ElectionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$pollingDate = now()->addWeeks(4)->toDateString();
|
||||
|
||||
return [
|
||||
'public_uuid' => (string) Str::uuid(),
|
||||
'name' => 'Pilihanraya Negeri '.fake()->year(),
|
||||
'code' => strtoupper(fake()->unique()->bothify('PRN-####')),
|
||||
'status' => 'active',
|
||||
'starts_at' => now()->toDateString(),
|
||||
'polling_date' => $pollingDate,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user