What's New in Laravel 13.35 | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://msaied.com)
2. /
3. [Articles](https://msaied.com/articles)
4. /
5. [Laravel](https://msaied.com/articles?category=laravel)
6. /
7. Route::query() and Model defaults() in Laravel 13.35

   [Laravel](https://msaied.com/articles?category=laravel) 

 Route::query() and Model defaults() in Laravel 13.35
=====================================================

 Laravel 13.35 ships Route::query() for the HTTP QUERY method, an opt-in HasDefaultAttributes trait for Eloquent models, cleaner fake assertions, percentage memory limits for queue workers, and more.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://msaied.com#person) Published 7 Oct 2026 · Updated 7 Oct 2026 · 3 min read

ShareCopy linkCopied

 ![Route::query() and Model defaults() in Laravel 13.35](https://cdn.msaied.com/750/bc3e713faaa9d7c80b19bb72f0b4f97d.png) 

  On this page +1. [What's New in Laravel 13.35](#whats-new-in-laravel-1335)
2. [Route::query() — HTTP QUERY Method Support](#routequery-http-query-method-support)
3. [Model defaults() via HasDefaultAttributes](#model-defaults-via-hasdefaultattributes)
4. [Property Arrays in Fake Assertions](#property-arrays-in-fake-assertions)
5. [Percentage Memory Limits for queue:work](#percentage-memory-limits-for-queuework)
6. [Schedule::alwaysOnOneServer()](#schedulealwaysononeserver)
7. [Stop Long-Running Scheduled Commands on Deploy](#stop-long-running-scheduled-commands-on-deploy)
8. [Other Notable Additions](#other-notable-additions)
9. [Key Takeaways](#key-takeaways)

 What's New in Laravel 13.35
---------------------------

Laravel v13.35.0 landed on October 7, 2026 with a solid set of developer-facing improvements. Here is a breakdown of the most impactful changes.

Route::query() — HTTP QUERY Method Support
------------------------------------------

Joel Butcher added `Route::query()`, which registers a route for the HTTP `QUERY` method. `QUERY` is a safe method that carries a request body, making it ideal for search endpoints whose filter payloads are too large for a query string.

```php
Route::query('/products/search', SearchProductsController::class);

```

Previously you had to write `Route::match(['QUERY'], ...)`. Now `QUERY` is a first-class verb in the router, so `Route::any()` and `Route::redirect()` also match it. Note that CSRF protection still applies to `QUERY` routes in the `web` middleware group — include a CSRF token or add the route to the `except` list.

Model defaults() via HasDefaultAttributes
-----------------------------------------

Wes Hooper back-ported the `defaults()` method from Laravel 14 as an opt-in trait. Unlike the static `$attributes` property, `defaults()` is a method, so values can come from config, feature flags, or runtime state.

```php
use Illuminate\Database\Eloquent\Concerns\HasDefaultAttributes;

class Subscription extends Model
{
    use HasDefaultAttributes;

    protected function defaults(): array
    {
        return [
            'cancelled' => false,
            'trial_days' => Feature::active('extended-trials') ? 30 : 14,
        ];
    }
}

```

The trait is opt-in to avoid breaking models that already have a method named `defaults()`. Values returned by `defaults()` take precedence over `$attributes` and are raw — they bypass casts and mutators.

Property Arrays in Fake Assertions
----------------------------------

Jack Bayliss updated the `Queue`, `Bus`, `Event`, and `Notification` fakes to accept a plain array of expected property values instead of a callback:

```php
// Before
Queue::assertPushed(ProcessPodcast::class, function ($job) use ($podcast, $user) {
    return $job->podcast->is($podcast) && $job->user->is($user) && $job->status === 'pending';
});

// After
Queue::assertPushed(ProcessPodcast::class, [
    'podcast' => $podcast,
    'user'    => $user,
    'status'  => 'pending',
]);

```

Eloquent models are compared with `is()`; all other values use strict equality. Properties must be public.

Percentage Memory Limits for queue:work
---------------------------------------

The `--memory` option on `queue:work` now accepts a percentage of PHP's `memory_limit`:

```bash
php artisan queue:work --memory=60%

```

With a `memory_limit` of `512M` this stops the worker after a job once it uses roughly 307 MB. If `memory_limit` is `-1` (common for the PHP CLI), the percentage resolves to a negative number and the worker never stops for memory — set an explicit limit when using percentages.

Schedule::alwaysOnOneServer()
-----------------------------

Another addition from Jack Bayliss: calling `Schedule::alwaysOnOneServer()` in a service provider applies `onOneServer()` to every scheduled task globally, removing the need to annotate each task individually.

```php
// AppServiceProvider::boot()
Schedule::alwaysOnOneServer();

```

Closure tasks without a name are skipped because `onOneServer()` requires a name to build the cache lock.

Stop Long-Running Scheduled Commands on Deploy
----------------------------------------------

`schedule:interrupt` now stores a timestamp (similar to `queue:restart`), and a new `Schedule::hasBeenInterruptedSince()` helper lets long-running background commands check for an interrupt and exit gracefully at a safe point.

Other Notable Additions
-----------------------

- **`response()->markdown()`** — returns a `text/markdown` response, pairing with the existing `$request->wantsMarkdown()`.
- **`lazy_root_creation` for local disks** — defers root directory creation until the first file write.
- Numerous Eloquent, collection, and query builder bug fixes.

Key Takeaways
-------------

- `Route::query()` makes the HTTP QUERY method a first-class citizen in Laravel routing.
- `HasDefaultAttributes` brings dynamic model defaults to Laravel 13 without breaking existing code.
- Fake assertions now accept property arrays, cutting boilerplate in tests.
- `queue:work --memory=60%` ties worker memory limits to container size automatically.
- `Schedule::alwaysOnOneServer()` simplifies multi-server scheduler configuration.

---

*Source: [Laravel News — Route::query() and Model defaults() in Laravel 13.35](https://laravel-news.com/laravel-13-35-0)*

- [Laravel](https://msaied.com/articles?search=Laravel)
- [Laravel 13](https://msaied.com/articles?search=Laravel%2013)
- [Eloquent](https://msaied.com/articles?search=Eloquent)
- [Routing](https://msaied.com/articles?search=Routing)
- [Queue](https://msaied.com/articles?search=Queue)
- [Scheduler](https://msaied.com/articles?search=Scheduler)

 Frequently asked questions 
---------------------------

  Does Route::query() require a CSRF token in the web middleware group?Yes. CSRF protection treats QUERY requests the same as POST requests, so a route registered with Route::query() inside the web middleware group needs a valid CSRF token or must be added to the CSRF except list.

   Why is HasDefaultAttributes an opt-in trait in Laravel 13 instead of being built into the base Model?The trait is opt-in to avoid breaking existing models that already define a method named defaults(). Adding it only to models that explicitly use the trait keeps the change non-breaking.

   What happens when queue:work --memory=60% is used and PHP's memory\_limit is set to -1?When memory\_limit is -1 (unlimited, common for the PHP CLI), the percentage resolves to a negative number and the worker never stops for memory reasons. You should set an explicit memory\_limit for the worker process if you intend to use a percentage.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://msaied.com#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://msaied.com#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleVMPal: Give Your AI Agent a Whole Computer to Work With](https://msaied.com/articles/vmpal-give-your-ai-agent-a-whole-computer-to-work-with)  

   On this page
-------------

1. [What's New in Laravel 13.35](#whats-new-in-laravel-1335)
2. [Route::query() — HTTP QUERY Method Support](#routequery-http-query-method-support)
3. [Model defaults() via HasDefaultAttributes](#model-defaults-via-hasdefaultattributes)
4. [Property Arrays in Fake Assertions](#property-arrays-in-fake-assertions)
5. [Percentage Memory Limits for queue:work](#percentage-memory-limits-for-queuework)
6. [Schedule::alwaysOnOneServer()](#schedulealwaysononeserver)
7. [Stop Long-Running Scheduled Commands on Deploy](#stop-long-running-scheduled-commands-on-deploy)
8. [Other Notable Additions](#other-notable-additions)
9. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://msaied.com#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/747/77f5a18ff2915d631224ade73cf34aa6.png) Laravel · 3 min read### VMPal: Give Your AI Agent a Whole Computer to Work With

6 Oct 2026 ](https://msaied.com/articles/vmpal-give-your-ai-agent-a-whole-computer-to-work-with) [ ![](https://cdn.msaied.com/745/8744e1be5136b430da52e9fca3ed3964.png)  · 3 min read### Service Container Deep Dive: Contextual Binding, Tagging, and Method Injection

6 Oct 2026 ](https://msaied.com/articles/service-container-deep-dive-contextual-binding-tagging-and-method-injection-1) [ ![](https://cdn.msaied.com/748/7ff67ebbfbb3e258ee49af67e3d29859.png) Composer Pacakge · 4 min read### Synapse: A Dev Dashboard for Laravel AI SDK Agents

6 Oct 2026 ](https://msaied.com/articles/synapse-a-dev-dashboard-for-laravel-ai-sdk-agents) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://msaied.com#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://msaied.com)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://msaied.com/sitemap.xml)
