feat: Add firstCaseInsensitive method to EntityControlTrait - #297
feat: Add firstCaseInsensitive method to EntityControlTrait#297artengin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2740a9fb2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
c2740a9 to
8d93cf2
Compare
|
@codex review |
8d93cf2 to
24ebeb6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ebeb6db4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| $wrappedField = $query->getGrammar()->wrap($field); | ||
|
|
||
| $result = $query | ||
| ->whereRaw("LOWER({$wrappedField}) = LOWER(?)", [$value]) |
There was a problem hiding this comment.
Preserve relation-field lookups
When callers use the same dotted field names that first()/findBy() already route through constructWhere() and applyWhereCallback() as whereHas filters, this raw predicate is added to the base model query instead. For example, firstCaseInsensitive('relation.email', ...) generates LOWER("relation"."email") without joining or entering the relation query, so it errors with a missing table/column rather than filtering the relation; handle dotted fields through the existing relation callback path before applying the LOWER comparison.
Useful? React with 👍 / 👎.
No description provided.