The Wire · Showcase
LARAVEL 13.x CUTS DEAD CODE FROM JSON:API RESOURCES, ADDS NATIVE ROUTE KEY ATTRIBUTES
By RepoJournal · Filed · About Laravel
The framework dropped never-executed generator logic that was silently re-resolving nested relationships on every request, while introducing a cleaner declarative way to customize route binding keys.
Laravel 13.x shipped a cleanup that removes dead code in JSON:API resource compilation [1]. The `compileIncludedNestedRelationshipsMap()` method was calling a generator function without iterating it, meaning the generator body never executed and nested relationships were being resolved twice for no reason. This is a pure removal with zero user impact, but it signals the framework's quality bar on 13.x work.
More important for day-to-day work: a new `#[RouteKey]` class attribute lands for Eloquent models [2]. Instead of overriding `getRouteKeyName()` on every model that needs a custom route binding key (slug, uuid, etc.), you now declare it directly on the class with PHP attributes, matching how `#[ObservedBy]` and `#[ScopedBy]` work. This is the Laravel attribute story continuing to mature.
Database connection handling got a new lost connection string added [3], improving error clarity when connections drop unexpectedly. On the docs side, Horizon worker options and metrics configuration are now properly documented [4], covering memory limits, job caps, and metrics trimming that were previously hidden in the published config stub. Horizon 5.48.0 also shipped a new `cspNonce()` method, now documented [5].
One email a day. Unsubscribe in one click.
What actually shipped in Laravel, written up every day — commits, pull requests, releases, and security advisories.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review the #[RouteKey] attribute syntax if you have models with custom route binding keys laravel/framework [plan]
- → Check Horizon docs for worker memory and job limits you may want to tune laravel/docs [monitor]
References
- [1] [13.x] Remove never-executed nested relationship compilation in JSON:API resources (#60829) laravel/framework
- [2] Add #[RouteKey] class attribute to Eloquent models ↗ laravel/framework
- [3] Added a new lost connection string and a test (#60819) laravel/framework
- [4] Document Horizon worker options and metrics snapshot trimming ↗ laravel/docs
- [5] Document Horizon::cspNonce method ↗ laravel/docs