SIGN IN SIGN UP
laravel / framework UNCLAIMED

Laravel is a web application framework with expressive, elegant syntax.

0 0 135 PHP

fix: `whereDate` and `whereTime` crash when $column is an `Expression` (#60314)

The `->whereDate` and `->whereTime` functions are typed to accept `Expression` or string as first parameter (`$column`). Since Laravel 12, both underlying functions in `PostgresGrammar` checks whether the `$column` is a JSON selector using the `isJsonSelector($value)` function defined in the base grammar. This function uses `str_contains` and causes a runtime exception if it receives something other than string. Currently, the function is called with the origin value of the `$column` parameter which in some cases may be `Expression`.

 This changes the parameter from the `isJsonSelector` to the wrapped column instead of the original one. It also adds tests which check, that using `Expression` or `Stringable` in `whereDate` and `whereTime` produces proper SQL.
A
Adrian committed
4d83904b41fe668d759272b2eacab6cad6b7d5c0
Parent: 88c5851
Committed by GitHub <noreply@github.com> on 5/29/2026, 11:38:04 PM