Split nested project route sections

This commit is contained in:
2026-04-15 16:08:15 +02:00
parent 0ed2b2429c
commit 75a573dca6
8 changed files with 144 additions and 115 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
use App\Http\Controllers\ProjectBoardController;
use App\Http\Controllers\ProjectTicketBranchController;
use App\Http\Controllers\ProjectTicketController;
use App\Http\Controllers\ProjectTicketLinkController;
use Illuminate\Support\Facades\Route;
Route::middleware('can:write-project,project')->group(function (): void {
Route::get('create', [ProjectTicketController::class, 'create'])->name('create');
Route::post('/', [ProjectTicketController::class, 'store'])->name('store');
});
Route::prefix('{ticket}')->group(function (): void {
Route::get('/', [ProjectTicketController::class, 'show'])
->middleware('can:view-project,project')
->name('show');
Route::middleware('can:write-project,project')->group(function (): void {
Route::patch('/', [ProjectTicketController::class, 'update'])->name('update');
Route::patch('status', [ProjectBoardController::class, 'move'])->name('status.update');
Route::prefix('branches')
->name('branches.')
->controller(ProjectTicketBranchController::class)
->group(function (): void {
Route::get('validate', 'validate')->name('validate');
Route::post('/', 'store')->name('store');
});
Route::prefix('links')
->name('links.')
->controller(ProjectTicketLinkController::class)
->group(function (): void {
Route::post('/', 'store')->name('store');
Route::delete('{ticketLink}', 'destroy')
->withoutScopedBindings()
->name('destroy');
});
});
});