What's New in Laravel 13.42: UUID Input &amp; More | 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. UUID Request Input and Migration Failure Events in Laravel 13.42

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

 UUID Request Input and Migration Failure Events in Laravel 13.42
=================================================================

 Laravel 13.42 ships uuid() and ulid() request helpers, a MigrationFailed event, scheduler skip reasons, custom lost-connection detection, Uri::origin(), and PendingProcess macros.

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

ShareCopy linkCopied

 ![UUID Request Input and Migration Failure Events in Laravel 13.42](https://cdn.msaied.com/825/79872f42a01264e81e9ee701c8c8d75b.png) 

  On this page +1. [What's New in Laravel 13.42](#whats-new-in-laravel-1342)
2. [UUID and ULID Request Input](#uuid-and-ulid-request-input)
3. [MigrationFailed Event](#migrationfailed-event)
4. [Scheduler Skip Reasons and JSON Timezones](#scheduler-skip-reasons-and-json-timezones)
5. [Custom Lost Connection Detection](#custom-lost-connection-detection)
6. [Uri::origin()](#uriorigin)
7. [PendingProcess Macros](#pendingprocess-macros)
8. [Other Notable Fixes](#other-notable-fixes)
9. [Key Takeaways](#key-takeaways)

 What's New in Laravel 13.42
---------------------------

Laravel v13.42.0 was released on November 11, 2026, bringing a focused set of developer-quality improvements across request handling, migrations, the scheduler, and database connections.

---

UUID and ULID Request Input
---------------------------

The `InteractsWithData` trait now exposes `uuid()` and `ulid()` methods alongside the existing `date()` and `enum()` helpers. Both return typed objects rather than raw strings:

```php
$request->uuid('order_id'); // Ramsey\Uuid\UuidInterface|null
$request->ulid('order_id'); // Symfony\Component\Uid\Ulid|null

$request->safe()->uuid('order_id');

```

Missing or empty input returns `null`; invalid input throws an exception. Because the methods live on the trait, they work everywhere `InteractsWithData` is used: validated input, `Fluent`, `Uri` query strings, Blade component attributes, and Artisan command input.

> **Note:** `ulid()` only accepts a genuine ULID string. Passing a UUID throws instead of silently converting it.

---

MigrationFailed Event
---------------------

A new `MigrationFailed` event fires whenever a migration throws. It carries the same `migration`, `method`, and `name` properties as the other migration events, plus the `exception`. The exception is still re-thrown after the event fires.

This is particularly useful on MySQL, where `ALTER TABLE` statements are not transactional — a failure mid-migration can leave the schema half-applied. You can now react immediately:

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

Event::listen(function (MigrationFailed $event) {
    Artisan::call('down');

    Log::channel('slack')->critical("Migration [{$event->name}] failed", [
        'exception' => $event->exception->getMessage(),
    ]);
});

```

---

Scheduler Skip Reasons and JSON Timezones
-----------------------------------------

The `ScheduledTaskSkipped` event gains a `reason` property holding a `ScheduledTaskSkipReason` enum with three cases: `ConditionNotMet`, `Paused`, and `RanOnAnotherServer`.

```php
Event::listen(function (ScheduledTaskSkipped $event) {
    Log::info('Scheduled task skipped', [
        'task'   => $event->task->getSummaryForDisplay(),
        'reason' => $event->reason?->value,
    ]);
});

```

`schedule:list --json` now returns each task's own cron expression and timezone instead of converting everything to the application timezone. This prevents DST-related drift in stored output. Passing `--timezone` still converts all tasks to a single timezone.

---

Custom Lost Connection Detection
--------------------------------

Laravel's built-in lost-connection detector checks a hard-coded list of error messages. `LostConnectionDetector::detectUsing()` lets you add a custom check without replacing the whole detector:

```php
use Illuminate\Database\LostConnectionDetector;

LostConnectionDetector::detectUsing(function (Throwable $e) {
    return str_contains($e->getMessage(), 'vttablet: rpc error');
});

```

When the callback returns `false`, Laravel falls back to its built-in message list.

---

Uri::origin()
-------------

The `Uri` class gains an `origin()` method that returns the normalized scheme, host, and port. For example, `https://App.example.com:443` normalizes to `https://app.example.com`. This makes same-origin checks straightforward:

```php
use Illuminate\Support\Uri;

$sameOrigin = Uri::of($first)->origin() === Uri::of($second)->origin();

```

This feature requires `league/uri` 7.6 or later.

---

PendingProcess Macros
---------------------

`PendingProcess` is now macroable, so custom process helpers can appear anywhere in a method chain:

```php
use Illuminate\Process\PendingProcess;
use Illuminate\Support\Facades\Process;

PendingProcess::macro('withHerd', function () {
    return $this->env(['PATH' => $herdBin.':'.getenv('PATH')]);
});

Process::tty()->withHerd()->run('composer global install');

```

---

Other Notable Fixes
-------------------

- `cursor()` now respects `Model::preventLazyLoading()`
- `TokenGuard::validate()` correctly hashes the token when hashing is enabled
- A failed commit caused by a lost connection now discards the PDO, allowing PostgreSQL to reconnect cleanly
- `foreignIdFor()` creates a `bigint` column for models with `$keyType = 'integer'` instead of `char(36)`
- `dispatch()->afterResponse()` reports exceptions instead of attempting to render them

---

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

- Use `$request->uuid()` and `$request->ulid()` to get typed UID objects directly from request input.
- Listen to `MigrationFailed` to put your app in maintenance mode before users hit a broken schema.
- `ScheduledTaskSkipped` now tells you *why* a task was skipped via the `reason` enum.
- `LostConnectionDetector::detectUsing()` handles custom database drivers or proxies without overriding the whole detector.
- `Uri::origin()` simplifies same-origin comparisons with automatic normalization.
- `PendingProcess` macros can now be chained freely, not just used as the first call.

---

*Source: [Laravel News — Laravel 13.42.0](https://laravel-news.com/laravel-13-42-0)*

- [Laravel](https://msaied.com/articles?search=Laravel)
- [Laravel 13](https://msaied.com/articles?search=Laravel%2013)
- [Migrations](https://msaied.com/articles?search=Migrations)
- [UUID](https://msaied.com/articles?search=UUID)
- [Scheduler](https://msaied.com/articles?search=Scheduler)
- [Release](https://msaied.com/articles?search=Release)

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

  What does $request-&gt;uuid() return in Laravel 13.42?It returns a `Ramsey\\Uuid\\UuidInterface` object when the input is a valid UUID, `null` when the input is missing or empty, and throws an exception when the input is present but not a valid UUID.

   How can I use the MigrationFailed event to protect my app from a broken schema?Listen for the `Illuminate\\Database\\Events\\MigrationFailed` event and call `Artisan::call('down')` inside the listener. The event provides the migration name and the exception, so you can also send an alert to Slack or another channel before users encounter the half-applied schema.

   Why did schedule:list --json output change in Laravel 13.42?Previously, every task's cron expression was converted to the application timezone, which caused stored output to drift by an hour after a DST change. Now each task reports its own timezone and expression. If you parse this JSON programmatically, review tasks that set a custom timezone() because their expression, timezone, and next\_due\_date values will differ from before.

   ![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 articleReplay Missed Laravel Scheduled Tasks With Schedule Catchup](https://msaied.com/articles/replay-missed-laravel-scheduled-tasks-with-schedule-catchup) [Next articleLaravel Read Replicas: Check if a Replica Has Caught Up with Commit IDs](https://msaied.com/articles/laravel-read-replicas-check-if-a-replica-has-caught-up-with-commit-ids)  

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

1. [What's New in Laravel 13.42](#whats-new-in-laravel-1342)
2. [UUID and ULID Request Input](#uuid-and-ulid-request-input)
3. [MigrationFailed Event](#migrationfailed-event)
4. [Scheduler Skip Reasons and JSON Timezones](#scheduler-skip-reasons-and-json-timezones)
5. [Custom Lost Connection Detection](#custom-lost-connection-detection)
6. [Uri::origin()](#uriorigin)
7. [PendingProcess Macros](#pendingprocess-macros)
8. [Other Notable Fixes](#other-notable-fixes)
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/826/01M7K1GYR3B8JV1TBK6JRYVW1Q.png) Laravel · 8 min read### Why I Built AutReply: One Inbox and an AI Assistant for WhatsApp, Instagram and Messenger

16 Nov 2026 ](https://msaied.com/articles/why-i-built-autreply-one-inbox-and-an-ai-assistant-for-whatsapp-instagram-and-messenger) [ ![](https://cdn.msaied.com/824/9cedece04b58444cb565a8bec2be1737.png) Laravel · 4 min read### Laravel AI SDK 1.4: Agents Now Recover From Tool Failures

12 Nov 2026 ](https://msaied.com/articles/laravel-ai-sdk-14-agents-now-recover-from-tool-failures) [ ![](https://cdn.msaied.com/822/5e40cb946aeac937ab3dc0017777ec8b.png) Laravel · 4 min read### Laravel Read Replicas: Check if a Replica Has Caught Up with Commit IDs

11 Nov 2026 ](https://msaied.com/articles/laravel-read-replicas-check-if-a-replica-has-caught-up-with-commit-ids) 

  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)
