feat: Implement API endpoints for retrieving product categories and their associated products.

This commit is contained in:
pbao9
2026-02-15 18:42:41 +07:00
parent 73ed05b20f
commit 4510cdc8eb
3 changed files with 344 additions and 1 deletions
+10
View File
@@ -3,6 +3,7 @@
use App\Http\Controllers\Api\Setting\SettingController;
use App\Http\Controllers\Api\Client\ClientController;
use App\Http\Controllers\Api\Service\OrderController;
use App\Http\Controllers\Api\Service\ProductCategoryController;
use App\Http\Controllers\Api\Service\ServiceController;
use Illuminate\Support\Facades\Route;
@@ -42,6 +43,15 @@ Route::prefix('v1')->group(function () {
Route::get('/', 'getSetting')->name('get');
});
});
// Product Categories - Protected Routes
Route::middleware(['api.auth'])->prefix('group')->as('product-categories.')->group(function () {
Route::controller(ProductCategoryController::class)->group(function () {
Route::get('get-list', 'getCategories')->name('getList');
Route::get('{product_categories:slug}', 'getDetailCategory')->name('detail');
Route::get('{parentSlug}/{childSlug}', 'getChildCategoryWithParent')->name('childWithParent');
});
});
});