32 lines
746 B
PHP
32 lines
746 B
PHP
<?php
|
|
|
|
namespace App\Actions\ProjectTicketMetadata;
|
|
|
|
use App\Models\Project;
|
|
|
|
class InitializeProjectTicketMetadata
|
|
{
|
|
public function handle(Project $project): void
|
|
{
|
|
if (! $project->ticketTypes()->exists()) {
|
|
$project->ticketTypes()->create([
|
|
'name' => 'Task',
|
|
'position' => 1,
|
|
]);
|
|
|
|
$project->ticketTypes()->create([
|
|
'name' => 'Release',
|
|
'is_parent' => true,
|
|
'position' => 2,
|
|
]);
|
|
}
|
|
|
|
if (! $project->ticketPriorities()->exists()) {
|
|
$project->ticketPriorities()->create([
|
|
'name' => 'Medium',
|
|
'position' => 1,
|
|
]);
|
|
}
|
|
}
|
|
}
|