chore: update composer dependencies to include phppresentation chore: update composer.lock after adding phppresentation feat: create categories migration for category management feat: create templates migration for template storage feat: create template generations migration for tracking template usage feat: create template keys migration for template customization feat: create notifications migration for user notifications feat: update API routes for categories, templates, and user profile management docs: update API documentation to include new endpoints for profile and wallet
47 lines
1.9 KiB
PHP
47 lines
1.9 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\AuthController;
|
|
use App\Http\Controllers\Api\CategoryController;
|
|
use App\Http\Controllers\Api\NotificationController;
|
|
use App\Http\Controllers\Api\ProfileController;
|
|
use App\Http\Controllers\Api\TemplateController;
|
|
use App\Http\Controllers\Api\TemplateGenerationController;
|
|
use App\Http\Controllers\Api\WalletController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::prefix('auth')->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::middleware('auth:sanctum')->group(function (): void {
|
|
Route::get('profile', [ProfileController::class, 'show']);
|
|
Route::put('profile', [ProfileController::class, 'update']);
|
|
|
|
Route::prefix('wallet')->group(function (): void {
|
|
Route::get('/', [WalletController::class, 'show']);
|
|
Route::get('transactions', [WalletController::class, 'transactions']);
|
|
});
|
|
|
|
Route::prefix('notifications')->group(function (): void {
|
|
Route::get('/', [NotificationController::class, 'index']);
|
|
Route::post('read-all', [NotificationController::class, 'markAllAsRead']);
|
|
});
|
|
|
|
Route::prefix('generations')->group(function (): void {
|
|
Route::get('{generation:uuid}', [TemplateGenerationController::class, 'show']);
|
|
Route::get('{generation:uuid}/download', [TemplateGenerationController::class, 'download'])->name('api.generations.download');
|
|
});
|
|
});
|