wilburpowery/routes-cached
routes-cached caches your Laravel application's compiled route collection so routes aren't re-registered on every request. This reduces bootstrap overhead and speeds up apps with large route files, with the cache refreshed whenever your route definitions change.
composer require wilburpowery/routes-cached) and register the card in app/Nova/NovaServiceProvider.php:public function cards()
{
return [
new \WilburPowery\RoutesCached\RoutesCached(),
];
}
Reload the Nova dashboard. The card renders a single boolean signal: routes are cached (🔥) or they aren't. There is no configuration file, no migrations, and no publishable assets to worry about.
Look first at the card's source (src/RoutesCached.php or equivalent) — it's tiny. It ultimately calls app()->routesAreCached(), which is the same check php artisan route:cache sets up. That one line is the whole package; everything else is Nova card plumbing.
First real use case: put it on a production/staging ops dashboard so on-call engineers can answer "did the deploy actually run route:cache?" at a glance, without SSHing into the box. This is the only scenario where it adds value over a deploy-script assertion.
Environment-scoped registration. Don't ship this to your local dashboard — cached routes in dev are noise and will confuse you when route:list doesn't reflect changes. Guard it:
public function cards()
{
return $this->whenAppEnvironment(['staging', 'production'], [
new \WilburPowery\RoutesCached\RoutesCached(),
]);
}
Or register conditionally inside the array:
return array_filter([
app()->isProduction() ? new RoutesCached() : null,
]);
Pair it with the inverse card. A "routes cached" indicator is useful next to a "config cached" and "queue running" card so your ops dashboard tells a coherent story. Consider combining with Laravel's built-in php artisan about health checks rather than several one-off cards.
Gate visibility. Nova cards respect authorization. If the card class doesn't expose a canSee hook, wrap registration behind the Gate::allows('viewNova') pattern or a role check so non-ops users don't see a confusing fire emoji.
Deployment-script integration. Treat the card as a verification surface, not the mechanism. Your deploy script should own the cache lifecycle:
php artisan route:clear
php artisan route:cache
The card then confirms the deploy succeeded. If you want this enforced, add a smoke test or post-deploy step that fails the pipeline when routesAreCached() returns false — don't rely on a human seeing a red card.
Extension pattern. Because the card is just a Nova card wrapper around a boolean, the cheapest extension is to copy the class into your app (e.g. App\Nova\Cards\RoutesCached) and add detail: route count, cache file mtime, last deploy hash. This is far safer than forking a 7-star abandoned package.
Version compatibility is the big one. The package was last released in September 2018, squarely in the Laravel Nova 1.x / PHP 7.x era. Nova's card API and PHP type constraints have moved a long way since (Nova 4/5, PHP 8.1+). Expect composer require to conflict or the card to render blank on modern Nova. Verify composer why-not wilburpowery/routes-cached before assuming it installed cleanly. If it won't install, the functionality is a five-line custom card — reproduce it rather than fighting constraints.
It only reports; it never acts. The card doesn't cache routes, clear them, or expose an action button. Don't expect a "fix it" click. If you want that, build a custom card with a Nova Action.
No live refresh. Nova cards hydrate when the dashboard loads. Caching routes on the server after the page rendered won't update the card until someone reloads. Do not treat a stale green/red state as a live health signal — pair it with a real monitoring check (Nova's health check endpoints, Laravel Pulse, UptimeRobot, etc.).
route:cache is not always desirable, and "cached" ≠ "healthy". Route caching is incompatible with closure-based routes — the artisan command will actually fail on closures. A card that says "not cached" might mean "deploy failed because of a closure route" rather than "someone forgot to cache." Read the deploy log, not just the emoji.
Local false positives. app()->routesAreCached() can read true on a developer machine after an accidental route:cache, which then causes hours of "why doesn't my route change take effect?" debugging. Keep the card off local entirely, and add php artisan route:clear to your onboarding docs.
Cache invalidation quirks. Editing routes without re-running route:cache means production serves stale routes while the card still shows 🔥. The indicator is not a staleness detector — it only says a cache file exists. If you need staleness detection, compare the cached bootstrap file's mtime against your route files.
Abandoned dependency risk. Seven stars, zero dependents, single release from 2018 — no security response, no Nova upgrades. For a production ops dashboard, the safer path is a custom Nova card or a simple php artisan about/health endpoint. Keep the package only as a reference implementation for how trivial the check is.
How can I help you explore Laravel packages today?