Laravel 13.44: Form Request Model Lookups &amp; PHP 8.6 | 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. Form Request Model Lookups and PHP 8.6 Support in Laravel 13.44

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

 Form Request Model Lookups and PHP 8.6 Support in Laravel 13.44
================================================================

 Laravel 13.44 ships form request model helpers, long-running transaction alerts, a PostgreSQL NO KEY UPDATE lock, a --schema-only migration flag, file-transfer options, and PHP 8.6 compatibility fixes.

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

ShareCopy linkCopied

 ![Form Request Model Lookups and PHP 8.6 Support in Laravel 13.44](https://cdn.msaied.com/838/ce69ce2737d75831f3116e7d1bb8f541.png) 

  On this page +1. [What's New in Laravel 13.44](#whats-new-in-laravel-1344)
2. [Model Lookups in Form Requests](#model-lookups-in-form-requests)
3. [Alerts for Long-Running Transactions](#alerts-for-long-running-transactions)
4. [lockForNoKeyUpdate() for PostgreSQL](#codelockfornokeyupdatecode-for-postgresql)
5. [Load the Schema Dump Without Running Migrations](#load-the-schema-dump-without-running-migrations)
6. [Options for copyToDisk() and moveToDisk()](#options-for-codecopytodiskcode-and-codemovetodiskcode)
7. [PHP 8.6 Support](#php-86-support)
8. [Key Takeaways](#key-takeaways)

 What's New in Laravel 13.44
---------------------------

The Laravel team released v13.44.0 on November 25, 2026, packing in several developer-quality-of-life improvements alongside important compatibility work for PHP 8.6.

---

### Model Lookups in Form Requests

Contributed by Steve Bauman, three new methods let you resolve Eloquent models directly from request input without writing boilerplate `findOrFail` calls in your controllers:

```php
$user  = $request->model('user_id', User::class);       // User|null
$user  = $request->modelOrFail('user_id', User::class); // User or ModelNotFoundException
$users = $request->models('user_ids', User::class);     // Eloquent collection

```

The model class argument is optional. When omitted, Laravel infers the class from the key name — `user_id` and `user_ids` both resolve to `App\Models\User` automatically.

---

### Alerts for Long-Running Transactions

Jack Bayliss added `DB::whenTransactionRunsLongerThan()`, which fires a callback after the outermost transaction commits or rolls back if it exceeded a given duration:

```php
use Carbon\CarbonInterval;
use Illuminate\Support\Facades\DB;

DB::whenTransactionRunsLongerThan(CarbonInterval::seconds(15), function ($connection, $event, $duration) {
    Log::warning("Transaction on [{$connection->getName()}] took {$duration}ms");
});

```

A plain integer is treated as milliseconds. Nested transactions are not timed separately — only the outermost one triggers the callback.

---

### `lockForNoKeyUpdate()` for PostgreSQL

Ali Morgan added `lockForNoKeyUpdate()` to the query builder. On PostgreSQL, a standard `lockForUpdate()` also blocks the implicit lock that foreign-key checks require, which can cause deadlocks when two transactions try to insert child rows referencing the same parent:

```php
DB::transaction(function () use ($teamId) {
    $team = Team::whereKey($teamId)->lockForNoKeyUpdate()->first();
    // Child rows referencing this team can still be inserted
});

```

On MySQL, SQLite, and SQL Server the method falls back to the same behaviour as `lockForUpdate()`, so it is safe to use across drivers.

---

### Load the Schema Dump Without Running Migrations

A new `--schema-only` flag for `migrate` and `migrate:fresh` loads the schema dump into the database and skips the subsequent migration files:

```bash
php artisan migrate:fresh --schema-only

```

This is particularly useful in test environments where migrations are managed separately or should not run at all.

---

### Options for `copyToDisk()` and `moveToDisk()`

Javad Seydi added an `$options` argument to both methods, letting you set visibility or driver-specific headers (e.g., S3 `CacheControl`) when transferring files between disks:

```php
Storage::disk('local')->moveToDisk('s3', 'tmp/report.pdf', 'reports/report.pdf', [
    'visibility'   => 'private',
    'CacheControl' => 'max-age=31536000',
]);

Storage::disk('local')->copyToDisk('s3', 'exports/users.csv', options: 'public');

```

Passing a plain string is treated as the visibility value, consistent with `Storage::put()`.

---

### PHP 8.6 Support

Mior Muhammad Zaki resolved the deprecations Laravel triggered on PHP 8.6, including the deprecated `SORT_LOCALE_STRING` flag, the `strcoll()` function, and a trimming issue in the validator. Laravel 13.44 is now compatible with PHP 8.6.

---

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

- **`$request->model()` / `modelOrFail()` / `models()`** eliminate repetitive Eloquent lookups in form requests.
- **`whenTransactionRunsLongerThan()`** makes slow-transaction monitoring straightforward.
- **`lockForNoKeyUpdate()`** prevents deadlocks on PostgreSQL when child rows reference a locked parent.
- **`--schema-only`** speeds up test setup by skipping migrations after a schema dump is loaded.
- **`copyToDisk()` / `moveToDisk()`** now accept visibility and driver options.
- **PHP 8.6 deprecations** are resolved; upgrading is safe.

---

[Read the original release notes on Laravel News](https://laravel-news.com/laravel-13-44-0)

- [Laravel](https://msaied.com/articles?search=Laravel)
- [PHP 8.6](https://msaied.com/articles?search=PHP%208.6)
- [Eloquent](https://msaied.com/articles?search=Eloquent)
- [Laravel Releases](https://msaied.com/articles?search=Laravel%20Releases)
- [Database](https://msaied.com/articles?search=Database)

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

  What does `$request-&gt;model()` do in Laravel 13.44 form requests?It resolves an Eloquent model from a request input key. For example, `$request-&gt;model('user\_id', User::class)` returns the matching User or null. `modelOrFail()` throws a ModelNotFoundException instead of returning null, and `models()` returns an Eloquent collection from a plural key. The model class is optional — Laravel infers it from the key name when omitted.

   Why use `lockForNoKeyUpdate()` instead of `lockForUpdate()` on PostgreSQL?On PostgreSQL, `lockForUpdate()` acquires a lock that also blocks the implicit lock foreign-key checks need. This means inserting a child row that references a locked parent row will wait, and two concurrent transactions can deadlock. `lockForNoKeyUpdate()` uses a weaker lock that allows foreign-key checks to proceed, eliminating that class of deadlock. On other drivers the two methods behave identically.

   How does the `--schema-only` flag work with `migrate:fresh`?Running `php artisan migrate:fresh --schema-only` loads the schema dump into a fresh database and then stops — it does not run the individual migration files that would normally follow. This is useful in test environments where the schema dump already represents the full database structure and running migrations separately would be redundant or cause conflicts.

   ![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 Black Friday and Cyber Monday Deals 2026](https://msaied.com/articles/laravel-black-friday-and-cyber-monday-deals-2026) [Next articlePun: Format, Lint, and Analyze PHP With One Rust Binary](https://msaied.com/articles/pun-format-lint-and-analyze-php-with-one-rust-binary)  

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

1. [What's New in Laravel 13.44](#whats-new-in-laravel-1344)
2. [Model Lookups in Form Requests](#model-lookups-in-form-requests)
3. [Alerts for Long-Running Transactions](#alerts-for-long-running-transactions)
4. [lockForNoKeyUpdate() for PostgreSQL](#codelockfornokeyupdatecode-for-postgresql)
5. [Load the Schema Dump Without Running Migrations](#load-the-schema-dump-without-running-migrations)
6. [Options for copyToDisk() and moveToDisk()](#options-for-codecopytodiskcode-and-codemovetodiskcode)
7. [PHP 8.6 Support](#php-86-support)
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/837/a736608b65db9fe102769f6c2479bef1.png) Laravel · 4 min read### Pun: Format, Lint, and Analyze PHP With One Rust Binary

26 Nov 2026 ](https://msaied.com/articles/pun-format-lint-and-analyze-php-with-one-rust-binary) [ ![](https://cdn.msaied.com/834/bd4177ac22f4bab6c85e743e4f0051e6.png) Laravel · 3 min read### Laravel Black Friday and Cyber Monday Deals 2026

23 Nov 2026 ](https://msaied.com/articles/laravel-black-friday-and-cyber-monday-deals-2026) [ ![](https://cdn.msaied.com/836/db1492ae4c7344b53fc65bb37075cf40.png) Laravel · 4 min read### Laravel Suspicious Login: Detect and Block Risky Logins with Risk Scoring

23 Nov 2026 ](https://msaied.com/articles/laravel-suspicious-login-detect-and-block-risky-logins-with-risk-scoring) 

  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)
