You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Laravel Version
10.45.1
PHP Version
8.3
Database Driver & Version
MYSQL 8.0
Description
I think there is a problem with Laravel's ORM.
We wanted to support both id and slug so this is our query:
$query->whereSlug("02t-19")->orWhere("id", "02t-19")->firstOrFail();
I was amazed that it also finds an id of product 2 with the wrong slug.
Steps To Reproduce
Route::bind('product', fn ($value) => Product::whereSlug($value)->orWhere('id', $value)->firstOrFail());
The text was updated successfully, but these errors were encountered: