Skip to content

[11.x] doesntContain on eloquent collection#54567

Merged
taylorotwell merged 1 commit into
laravel:11.xfrom
gdebrauwer:eloquent-collection-doesnt-contain
Feb 12, 2025
Merged

[11.x] doesntContain on eloquent collection#54567
taylorotwell merged 1 commit into
laravel:11.xfrom
gdebrauwer:eloquent-collection-doesnt-contain

Conversation

@gdebrauwer
Copy link
Copy Markdown
Contributor

I was surprised that the eloquent collection has a contains method but not a doesntContain method, so this PR adds that method 😄

$users->doesntContain($someUser);

@taylorotwell taylorotwell merged commit 8e9d24e into laravel:11.x Feb 12, 2025
@mnaderian
Copy link
Copy Markdown

God I needed that. Thank you @gdebrauwer.

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.

3 participants