Add Popular Routes
Curated from/to destination pairs for marketing content, editable via a Filament resource and served publicly (no auth, IP-throttled like CMS pages) through GET /api/v1/popular-routes. The API response trims each nested destination down to id/name/mm_name rather than the full catalog resource.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Routing\Http\Controllers\EvRouteController;
|
||||
use Modules\Routing\Http\Controllers\PopularRouteController;
|
||||
|
||||
Route::prefix('api/v1')->middleware(['api', 'api.auth', 'throttle:api-read'])->group(function () {
|
||||
Route::post('/routes/search', [EvRouteController::class, 'search'])->name('routing.routes.search');
|
||||
@@ -9,3 +10,10 @@ Route::prefix('api/v1')->middleware(['api', 'api.auth', 'throttle:api-read'])->g
|
||||
Route::get('/routes/{route}/pricing', [EvRouteController::class, 'pricing'])->name('routing.routes.pricing');
|
||||
Route::get('/routes/{route}/time-slots', [EvRouteController::class, 'timeSlots'])->name('routing.routes.time-slots');
|
||||
});
|
||||
|
||||
// Popular Routes are curated marketing content, typically shown before the
|
||||
// user logs in (like CMS pages), so this group skips api.auth —
|
||||
// throttle:api-read still rate-limits it by IP.
|
||||
Route::prefix('api/v1')->middleware(['api', 'throttle:api-read'])->group(function () {
|
||||
Route::get('/popular-routes', [PopularRouteController::class, 'index'])->name('routing.popular-routes.index');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user