Skip to content

feat: Add firstCaseInsensitive method to EntityControlTrait - #297

Open
artengin wants to merge 1 commit into
masterfrom
add-case-insensitive-method-to-entity-control-trait
Open

feat: Add firstCaseInsensitive method to EntityControlTrait#297
artengin wants to merge 1 commit into
masterfrom
add-case-insensitive-method-to-entity-control-trait

Conversation

@artengin

Copy link
Copy Markdown
Contributor

No description provided.

@artengin artengin self-assigned this Jun 26, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/Traits/EntityControlTrait.php Outdated
@artengin
artengin force-pushed the add-case-insensitive-method-to-entity-control-trait branch from c2740a9 to 8d93cf2 Compare June 26, 2026 13:53
@artengin

Copy link
Copy Markdown
Contributor Author

@codex review

@artengin
artengin force-pushed the add-case-insensitive-method-to-entity-control-trait branch from 8d93cf2 to 24ebeb6 Compare June 26, 2026 13:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant