b6934e1fb5
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.
20 lines
1.1 KiB
PHP
20 lines
1.1 KiB
PHP
<?php
|
|
|
|
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');
|
|
Route::get('/routes/{route}', [EvRouteController::class, 'show'])->name('routing.routes.show');
|
|
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');
|
|
});
|