kusowl 920666c201 feature: add index endpoint for products
- implement DTO for product and modify productImageDTO.
- add products resources and collection.
2026-02-27 18:16:02 +05:30

21 lines
836 B
PHP

<?php
use App\Http\Controllers\AuthenticatedUserController;
use App\Http\Controllers\ProductCategoryController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\ProductImagesController;
use App\Http\Controllers\RegisteredUserController;
use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::post('/register', RegisteredUserController::class);
});
Route::middleware('auth:sanctum')->group(function () {
Route::get('/user', [AuthenticatedUserController::class, 'show']);
Route::post('/logout', [AuthenticatedUserController::class, 'destroy']);
Route::post('/upload/images', action: [ProductImagesController::class, 'store']);
});
Route::get('/categories', [ProductCategoryController::class, 'index']);
Route::apiResource('products', ProductController::class);