---
title: "Query Binding Masking and whereBinary() in Laravel 13.27"
url: https://daily.dev/posts/query-binding-masking-and-wherebinary-in-laravel-13-27-cjmmnmpzq
source_url: https://laravel-news.com/laravel-13-27-0
type: article
source: "Laravel News"
published: 2026-08-26T13:59:12.953Z
updated: 2026-08-26T14:22:52.287Z
tags: ["php", "laravel", "mysql"]
reading_time: 8
upvotes: 4
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.

# Query Binding Masking and whereBinary() in Laravel 13.27

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

## Summary

Laravel 13.27 introduces a per-connection setting that masks query bindings out of exception messages, preventing sensitive data like emails from leaking into logs and APM spans. It adds a whereBinary() family for byte-exact, case-sensitive comparisons on MySQL and MariaDB, plus refreshForUpdate() to reload an Eloquent model under a pessimistic lock without re-querying by primary key. Other additions include a Cloud facade for Laravel Cloud checks, queue total-size methods across all queues, MariaDB support for vector distance queries, Postgres keepalive DSN options, shared AWS credential caching for SQS, and several input-handling and validation-hardening fixes.

## Full article

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

## Questions this post answers

### How do I stop Laravel from putting bound query values into exception messages?

Laravel 13.27 adds a per-connection config key called mask_bindings_in_exception_messages that keeps ? placeholders in QueryException messages instead of interpolating the actual values. Set it via DB_MASK_BINDINGS=true, since the key already ships in the framework's default config/database.php. It defaults to false, and only the exception message text changes; getBindings() still returns real values.

_daily.dev surfaces framework release details like this for teams hardening logging and error handling in Laravel._

### How do I do a case-sensitive WHERE query in Laravel with MySQL?

Laravel 13.27 adds whereBinary(), orWhereBinary(), whereNotBinary(), and orWhereNotBinary() to the query builder for byte-exact comparisons on MySQL and MariaDB, replacing the need for whereRaw('name = BINARY ?'). Postgres, SQLite, and SQL Server throw a RuntimeException since those already compare case sensitively by default.

_Developers picking the right case-sensitivity approach per database engine can track Laravel query builder changes on daily.dev._

### How do I take a pessimistic lock on an Eloquent model I already loaded before a transaction started?

Laravel 13.27 introduces refreshForUpdate(), which behaves like refresh() but applies lockForUpdate() to the reload query, refreshing the existing model instance in place rather than requiring a fresh findOrFail() query by primary key. It must be called inside a transaction, since the lock only holds for the transaction's lifetime, and it closes the read-then-write data race on that model.

_daily.dev helps developers dealing with concurrency and locking bugs in Laravel keep up with fixes like this._

## Similar posts on daily.dev

- [Query Builder Expression Aliases in Laravel 12.48](https://daily.dev/posts/query-builder-expression-aliases-in-laravel-12-48-hochgcfjt) · Laravel News · 13 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

---

Tags: [#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/query-binding-masking-and-wherebinary-in-laravel-13-27-cjmmnmpzq)
