group(function (): void { Route::post('register', [AuthController::class, 'register']); Route::post('login', [AuthController::class, 'login']); }); Route::get('categories', [CategoryController::class, 'index']); Route::prefix('templates')->group(function (): void { Route::get('/', [TemplateController::class, 'index']); Route::get('{template:slug}', [TemplateController::class, 'show']); Route::middleware('auth:sanctum')->group(function (): void { Route::post('{template:slug}/generate', [TemplateGenerationController::class, 'store']); Route::post('{template:slug}/generate-from-text', [TemplateGenerationController::class, 'storeFromText']); }); }); Route::get('wallet/deposits/{deposit}/callback', [WalletDepositController::class, 'callback'])->name('api.wallet.deposits.callback'); Route::middleware('auth:sanctum')->group(function (): void { Route::get('profile', [ProfileController::class, 'show']); Route::put('profile', [ProfileController::class, 'update']); Route::put('profile/password', [ProfileController::class, 'changePassword']); Route::delete('profile', [ProfileController::class, 'destroy']); Route::prefix('wallet')->group(function (): void { Route::get('/', [WalletController::class, 'show']); Route::get('transactions', [WalletController::class, 'transactions']); Route::post('deposits', [WalletDepositController::class, 'store']); }); Route::prefix('notifications')->group(function (): void { Route::get('/', [NotificationController::class, 'index']); Route::post('read-all', [NotificationController::class, 'markAllAsRead']); Route::get('preferences', [NotificationController::class, 'preferences']); Route::put('preferences', [NotificationController::class, 'updatePreferences']); }); Route::prefix('generations')->group(function (): void { Route::get('/', [TemplateGenerationController::class, 'index']); Route::get('{generation:uuid}', [TemplateGenerationController::class, 'show']); Route::get('{generation:uuid}/download', [TemplateGenerationController::class, 'download'])->name('api.generations.download'); }); });