33 lines
925 B
PHP
33 lines
925 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Issue;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class IssueFactory extends Factory
|
|
{
|
|
protected $model = Issue::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'issue_number' => null, // auto-generated in model boot
|
|
'title' => $this->faker->sentence(),
|
|
'description' => $this->faker->paragraph(),
|
|
'issue_type' => Issue::TYPE_WORK_ITEM,
|
|
'status' => Issue::STATUS_NEW,
|
|
'priority' => Issue::PRIORITY_MEDIUM,
|
|
'created_by_user_id' => User::factory(),
|
|
'assigned_to_user_id' => null,
|
|
'reviewer_id' => null,
|
|
'member_id' => null,
|
|
'parent_issue_id' => null,
|
|
'due_date' => now()->addDays(7),
|
|
'estimated_hours' => 4,
|
|
'actual_hours' => 0,
|
|
];
|
|
}
|
|
}
|