47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\GitlabMilestone;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* Factory for generating GitlabMilestone model instances with randomized data.
|
|
*
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\GitlabMilestone>
|
|
*/
|
|
class GitlabMilestoneFactory extends Factory
|
|
{
|
|
/**
|
|
* Associated model.
|
|
*
|
|
* @var class-string<\App\Models\GitlabMilestone>
|
|
*/
|
|
#[\Override]
|
|
protected $model = GitlabMilestone::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$isClosed = fake()->boolean(25);
|
|
|
|
return [
|
|
'title' => fake()->words(3, true),
|
|
'url' => fake()->url(),
|
|
'is_closed' => $isClosed,
|
|
'gitlab_id' => fake()->numberBetween(1, 1000),
|
|
'gitlab_iid' => fake()->numberBetween(1, 1000),
|
|
'gitlab_project_id' => fake()->numberBetween(1, 1000),
|
|
'g_created_at' => fake()->date(),
|
|
'g_updated_at' => fake()->date(),
|
|
'g_closed_at' => $isClosed ? fake()->date() : null,
|
|
'g_due_date' => fake()->boolean(25) ? fake()->date() : null,
|
|
];
|
|
}
|
|
}
|