The Laravel framework team has released version 13.35.0, expanding the core toolkit with support for HTTP QUERY route definitions, dynamic Eloquent model default values, relative queue worker memory limits, and improved multi-server scheduling features.
Native HTTP QUERY Routing
Laravel 13.35 introduces the Route::query() helper method to simplify route registration for the HTTP QUERY verb. Designed for read operations with payload bodies that exceed standard URL length limits, such as complex search filters, the QUERY verb is now fully recognized within the framework's internal HTTP method registry.
As a result of adding QUERY to the verb list, global routing macros like Route::any() and Route::redirect() automatically accommodate QUERY requests. The update maintains standard web middleware conventions, requiring QUERY requests to pass CSRF validation unless specifically exempted in the configuration.
Dynamic Model Defaults and Property Fakes
Developers can now define dynamic default attribute values on Eloquent models by using the opt-in HasDefaultAttributes trait and implementing a defaults() method. This allows default values to incorporate runtime context, such as current feature flags or dynamic dates, overriding static $attributes definitions while skipping casts and mutators. The feature requires explicit inclusion of the trait to avoid conflicts with existing models that already define a defaults() method.
Additionally, testing fakes for Queue, Bus, Event, and Notification services now accept key-value arrays to assert expected public property values. Matching relies on strict equality checks, while Eloquent models are evaluated using their dedicated identity verification methods.
Worker Memory Caps and Deployment Safeguards
For containerized deployments, the queue:work command now supports percentage values within its –memory flag, automatically scaling memory thresholds based on PHP's configured memory_limit. When using percentage limits, developers must ensure a positive CLI memory limit is defined, as unbound CLI environments resolve percentages to negative numbers that disable automatic worker process termination.
For task orchestration across infrastructure replicas, the release adds Schedule::alwaysOnOneServer(), allowing developers to globally enforce single-server execution across all scheduled tasks without wrapping individual definitions in group calls. Unnamed closure tasks are skipped because atomic lock creation requires explicit task identifiers. Additionally, long-running scheduled commands can now check Schedule::hasBeenInterruptedSince() to safely stop execution when a deployment triggers schedule:interrupt.
Markdown Responses and Storage Options
The update introduces a response()->markdown() factory method that returns responses with a text/markdown content type, complementing existing request inspection utilities. Local filesystem storage configurations also gain a lazy_root_creation flag, deferring target directory creation until the initial file write operation occurs.
AI-generated editorial illustration; not a documentary photograph.
Source: Route::query() and Model defaults() in Laravel 13.35

Leave a Reply