---
title: "Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout"
url: https://daily.dev/posts/laravel-12-51-0-adds-aftersending-callbacks-validator-whenfails-and-mysql-timeout-y0ofekzyb
source_url: https://laravel-news.com/laravel-12-51-0
type: article
source: "Laravel News"
published: 2026-02-11T14:03:45.073Z
updated: 2026-02-11T14:04:08.228Z
tags: ["testing", "php", "laravel", "mysql"]
reading_time: 5
upvotes: 12
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel 12.51.0 Adds afterSending Callbacks, Validator whenFails, and MySQL Timeout

**[Laravel News](https://daily.dev/sources/ln)** · 5 min read · 12 upvotes · 0 comments

## Summary

Laravel 12.51.0 introduces notification afterSending callbacks for post-send logic, fluent whenFails and whenPasses validator methods for non-HTTP contexts, and a MySQL-specific query timeout method. The release adds closure support in firstOrCreate and createOrFirst for lazy evaluation of expensive operations, a BatchCancelled event for monitoring batch job cancellations, and the ability to use Eloquent builders directly as subqueries in updates. Additional improvements include a withoutHeader response method, enhanced batch testing assertions, cache isolation for parallel tests, and numerous bug fixes across database operations, string helpers, queue middleware, and framework internals.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/laravel-12-51-0>

## Similar posts on daily.dev

- [Http Client Batch Method in Laravel 12.32](https://daily.dev/posts/http-client-batch-method-in-laravel-12-32-s5s1v5pnx) · Laravel News · 35 upvotes · 0 comments
- [New Expressive Model Attributes in Laravel 13.2.0](https://daily.dev/posts/new-expressive-model-attributes-in-laravel-13-2-0-d4iyewmhw) · Laravel News · 24 upvotes · 0 comments
- [Laravel November Product Releases](https://daily.dev/posts/laravel-november-product-releases-sbco9ymz6) · Laravel · 15 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#mysql](https://daily.dev/tags/mysql)

[View this post on daily.dev](https://daily.dev/posts/laravel-12-51-0-adds-aftersending-callbacks-validator-whenfails-and-mysql-timeout-y0ofekzyb)
