Add ticket-driven branch creation flow

This commit is contained in:
2026-03-26 09:39:18 +01:00
parent 789675f83f
commit 92dfe3840c
47 changed files with 1332 additions and 50 deletions
@@ -0,0 +1,28 @@
<?php
namespace App\Actions\Git;
use App\Models\Ticket;
use Illuminate\Support\Str;
class BuildSuggestedTicketBranchName
{
public function handle(Ticket $ticket): string
{
$titleSlug = Str::of($ticket->title)
->lower()
->replaceMatches('/[^a-z0-9\s-]+/', '')
->trim()
->replaceMatches('/\s+/', '-')
->replaceMatches('/-+/', '-')
->value();
$ticketKey = Str::lower($ticket->ticket_key);
if ($titleSlug === '') {
return $ticketKey;
}
return "{$ticketKey}-{$titleSlug}";
}
}