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:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Routing\Observers;
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Modules\Routing\Models\PopularRoute;
|
||||
|
||||
class PopularRouteObserver
|
||||
{
|
||||
public function saved(PopularRoute $popularRoute): void
|
||||
{
|
||||
Cache::tags('routes')->flush();
|
||||
}
|
||||
|
||||
public function deleted(PopularRoute $popularRoute): void
|
||||
{
|
||||
Cache::tags('routes')->flush();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user