What's New in Laravel 13.45: Key Features &amp; Fixes | 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. Migration Durations and Job Memory Usage in Laravel 13.45

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

 Migration Durations and Job Memory Usage in Laravel 13.45
==========================================================

 Laravel 13.45 adds migration duration tracking on MigrationEnded, peak memory usage on JobAttempted, batched database cache writes, and security fixes for SVG uploads and trusted proxies.

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

ShareCopy linkCopied

 ![Migration Durations and Job Memory Usage in Laravel 13.45](https://cdn.msaied.com/843/4b47e60127e1da7f55c7f483ae7352d4.png) 

  On this page +1. [What's New in Laravel 13.45](#whats-new-in-laravel-1345)
2. [Migration Duration on the MigrationEnded Event](#migration-duration-on-the-codemigrationendedcode-event)
3. [Peak Memory Usage on the JobAttempted Event](#peak-memory-usage-on-the-codejobattemptedcode-event)
4. [Batched Writes and Deletes for the Database Cache Store](#batched-writes-and-deletes-for-the-database-cache-store)
5. [Security: dimensions Rule Now Requires SVG to Be Explicitly Allowed](#security-codedimensionscode-rule-now-requires-svg-to-be-explicitly-allowed)
6. [Security: Wildcard Trusted Proxies Reverted to Trust Only REMOTE\_ADDR](#security-wildcard-trusted-proxies-reverted-to-trust-only-coderemote-addrcode)
7. [Request::prefetch() Now Recognizes Prerender Requests](#coderequestprefetchcode-now-recognizes-prerender-requests)
8. [Key Takeaways](#key-takeaways)

 What's New in Laravel 13.45
---------------------------

The Laravel team shipped v13.45.0 on December 2, 2026, with several developer-experience improvements and two security-related behavior changes. Here is a breakdown of everything worth knowing.

---

### Migration Duration on the `MigrationEnded` Event

Jack Bayliss added a `duration` property to the `MigrationEnded` event. The value is the number of milliseconds the migration took to run, for both `up` and `down` directions.

```php
use Illuminate\Database\Events\MigrationEnded;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Log;

Event::listen(function (MigrationEnded $event) {
    if ($event->duration > 60_000) {
        Log::warning("Migration [{$event->name}] took {$event->duration}ms.");
    }
});

```

Paired with the migration failure events added in Laravel 13.42, you can now monitor both slow and failed migrations during deployments.

---

### Peak Memory Usage on the `JobAttempted` Event

Also from Jack Bayliss, the `JobAttempted` event now carries a `memoryUsage` property — the worker's peak memory in megabytes for that single job. PHP's peak memory counter is reset before each job, so the value is isolated to one attempt, not the worker's lifetime.

```php
use Illuminate\Queue\Events\JobAttempted;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Log;

Event::listen(function (JobAttempted $event) {
    Log::info($event->job->resolveName(), [
        'duration' => $event->duration,
        'memory'   => $event->memoryUsage,
    ]);
});

```

The event fires whether the job succeeds or fails, making it a reliable hook for performance observability.

---

### Batched Writes and Deletes for the Database Cache Store

Rias updated `putMany()` (without a TTL) and `deleteMultiple()` on the database cache driver to batch operations at 250 keys per query instead of one query per key.

```php
// 600 keys: 3 queries instead of 600
Cache::store('database')->putMany($values);
Cache::store('database')->deleteMultiple($keys);

```

The 250-key chunk size keeps queries under SQL Server's 2,100 bound-parameter limit. In benchmarks from the pull request, writing 3,000 keys on SQL Server 2022 dropped from 3,514 ms to 146 ms. This follows a similar Redis pipelining improvement in Laravel 13.44.

---

### Security: `dimensions` Rule Now Requires SVG to Be Explicitly Allowed

Before this release, the `dimensions` validation rule silently passed any SVG upload without inspecting it, which could allow SVGs containing embedded JavaScript through a field validated only with `dimensions`.

SVGs now pass `dimensions` only when another rule on the same attribute explicitly permits them:

```php
// Fails for an SVG upload
'avatar' => ['dimensions:max_width=1000'],

// Passes for an SVG upload
'avatar' => ['image:allow_svg', 'dimensions:max_width=1000'],
'avatar' => ['mimes:png,jpg,svg', 'dimensions:max_width=1000'],

```

If your application accepts SVG uploads on any field that uses `dimensions`, add `image:allow_svg`, a `mimes` rule including `svg`, or a `mimetypes` rule including `image/svg+xml`.

---

### Security: Wildcard Trusted Proxies Reverted to Trust Only `REMOTE_ADDR`

A previous change caused `trustProxies(at: '*')` to trust every address in the `X-Forwarded-For` header, making the client-controlled left-most entry the resolved client IP. This release reverts the wildcard to its v13.19.0 behavior: it trusts only the directly calling proxy (`REMOTE_ADDR`), preventing IP spoofing.

---

### `Request::prefetch()` Now Recognizes Prerender Requests

Chrome sends `Sec-Purpose: prefetch;prerender` for pages prerendered via the Speculation Rules API. `Request::prefetch()` previously matched only the exact string `prefetch`, so prerendered pages were not recognized. The fix ensures `back()` does not redirect users to a page they never actually visited.

---

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

- **Observability**: Listen to `MigrationEnded` for slow-migration alerts and `JobAttempted` for per-job memory profiling.
- **Performance**: Database cache `putMany()` and `deleteMultiple()` now batch at 250 keys per query — a dramatic speedup for bulk operations.
- **Security (action required)**: Audit any field that uses the `dimensions` rule and accepts SVG uploads; add an explicit SVG-allowing rule.
- **Security**: Wildcard trusted proxies no longer expose your app to IP spoofing via `X-Forwarded-For`.
- **Bug fix**: `Request::prefetch()` correctly handles Chrome's prerender requests, keeping session history clean.

---

Source: [Laravel News — Laravel 13.45.0](https://laravel-news.com/laravel-13-45-0)

- [Laravel](https://msaied.com/articles?search=Laravel)
- [Laravel 13](https://msaied.com/articles?search=Laravel%2013)
- [Queue](https://msaied.com/articles?search=Queue)
- [Database Migrations](https://msaied.com/articles?search=Database%20Migrations)
- [Security](https://msaied.com/articles?search=Security)
- [Cache](https://msaied.com/articles?search=Cache)

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

  How do I log slow migrations in Laravel 13.45?Listen to the `MigrationEnded` event and check its `duration` property, which holds the migration run time in milliseconds. You can log a warning or trigger an alert when the value exceeds your threshold.

   Does the SVG dimensions rule change break existing applications?It can. If you have a file upload field validated only with `dimensions` that accepts SVG files, those uploads will now fail validation. Add `image:allow\_svg`, a `mimes` rule that includes `svg`, or a `mimetypes` rule that includes `image/svg+xml` to the same field to restore SVG acceptance.

   What does the `memoryUsage` property on `JobAttempted` measure?It holds the worker's peak memory usage in megabytes during that single job attempt. Laravel resets PHP's peak memory counter before each job, so the value reflects only the job being processed, not the entire worker lifetime.

   ![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 articleLaravel Rust Benchmarked: 18× the Throughput of Laravel PHP](https://msaied.com/articles/laravel-rust-benchmarked-18-the-throughput-of-laravel-php)  

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

1. [What's New in Laravel 13.45](#whats-new-in-laravel-1345)
2. [Migration Duration on the MigrationEnded Event](#migration-duration-on-the-codemigrationendedcode-event)
3. [Peak Memory Usage on the JobAttempted Event](#peak-memory-usage-on-the-codejobattemptedcode-event)
4. [Batched Writes and Deletes for the Database Cache Store](#batched-writes-and-deletes-for-the-database-cache-store)
5. [Security: dimensions Rule Now Requires SVG to Be Explicitly Allowed](#security-codedimensionscode-rule-now-requires-svg-to-be-explicitly-allowed)
6. [Security: Wildcard Trusted Proxies Reverted to Trust Only REMOTE\_ADDR](#security-wildcard-trusted-proxies-reverted-to-trust-only-coderemote-addrcode)
7. [Request::prefetch() Now Recognizes Prerender Requests](#coderequestprefetchcode-now-recognizes-prerender-requests)
8. [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/842/f1f2dcfcc09498d0833e073d339309c7.png) Laravel · 3 min read### Laravel Rust Benchmarked: 18× the Throughput of Laravel PHP

1 Dec 2026 ](https://msaied.com/articles/laravel-rust-benchmarked-18-the-throughput-of-laravel-php) [ ![](https://cdn.msaied.com/841/c1d2916389c95533967f0a593b3c14e0.png) Laravel · 4 min read### How Laravel Cloud Packs Kubernetes Nodes Efficiently

1 Dec 2026 ](https://msaied.com/articles/how-laravel-cloud-packs-kubernetes-nodes-efficiently) [ ![](https://cdn.msaied.com/840/0ea4b7fd609b1d36553ed8f714446b8d.png) Laravel · 3 min read### How Laravel News Cut Its Laravel Cloud Bill Nearly in Half

30 Nov 2026 ](https://msaied.com/articles/how-laravel-news-cut-its-laravel-cloud-bill-nearly-in-half) 

  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)
