Current state
This commit is contained in:
35
routes/api.php
Normal file
35
routes/api.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/**
|
||||
* API v1 routes for Artworks module
|
||||
*
|
||||
* GET /api/v1/artworks/{slug}
|
||||
* GET /api/v1/categories/{slug}/artworks
|
||||
*/
|
||||
Route::prefix('v1')->name('api.v1.')->group(function () {
|
||||
// Public browse feed (authoritative tables only)
|
||||
Route::get('browse', [\App\Http\Controllers\Api\BrowseController::class, 'index'])
|
||||
->name('browse');
|
||||
|
||||
// Browse by content type + category path (slug-based)
|
||||
Route::get('browse/{contentTypeSlug}/{categoryPath}', [\App\Http\Controllers\Api\BrowseController::class, 'byCategoryPath'])
|
||||
->where('contentTypeSlug', '[a-z0-9\-]+')
|
||||
->where('categoryPath', '.+')
|
||||
->name('browse.category');
|
||||
|
||||
// Browse by content type only (slug-based)
|
||||
Route::get('browse/{contentTypeSlug}', [\App\Http\Controllers\Api\BrowseController::class, 'byContentType'])
|
||||
->where('contentTypeSlug', '[a-z0-9\-]+')
|
||||
->name('browse.content_type');
|
||||
|
||||
// Public artwork by slug
|
||||
Route::get('artworks/{slug}', [\App\Http\Controllers\Api\ArtworkController::class, 'show'])
|
||||
->where('slug', '[A-Za-z0-9\-]+')
|
||||
->name('artworks.show');
|
||||
|
||||
// Category artworks (Category route-model binding uses slug)
|
||||
Route::get('categories/{category}/artworks', [\App\Http\Controllers\Api\ArtworkController::class, 'categoryArtworks'])
|
||||
->name('categories.artworks');
|
||||
});
|
||||
Reference in New Issue
Block a user