Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Eloquent Where Not

Laravel Eloquent Where Not Laravel Package

protonemedia/laravel-eloquent-where-not

Adds whereNot and orWhereNot methods to Laravel Eloquent, letting you negate simple conditions, nested closures, and relationships cleanly. A small, expressive package for readable inverse WHERE clauses without raw SQL or awkward operator flipping.

View on GitHub
Deep Wiki
Context7

Laravel package to invert Eloquent scopes.

Frequently asked questions about Laravel Eloquent Where Not
How do I install protonemedia/laravel-eloquent-where-not?
Install it with Composer using composer require protonemedia/laravel-eloquent-where-not. The package uses Laravel auto-discovery, so the whereNot and orWhereNot builder macros should be registered without manual service provider changes. Pin the dependency to a specific version for any pilot, since release 1.2.0 is the only version with an explicit Laravel 9 compatibility claim.
Does this package support Laravel 10 and Laravel 11?
No verified support exists for Laravel 10 or Laravel 11. Release 1.2.0 only adds a claim of Laravel 9 support; newer Laravel versions remain unproven. Before using it on anything other than Laravel 9, check composer.json constraints and run contract tests against your target framework version.
Which PHP versions does laravel-eloquent-where-not support?
PHP version constraints are not established by the release notes, which only mention Laravel 9 support. You must inspect the package composer.json to confirm whether your PHP 8.x version is allowed. Compatibility with PHP 8.2 and 8.3 should be treated as unproven until tests pass on your target runtime.
What is the difference between whereNot and Laravel's native negation options?
whereNot is a query-builder macro that inverts a condition, nested closure, or relationship constraint without raw SQL or manually flipping operators. Laravel's native negation patterns and closure-based conditions may already cover many of the same use cases. Inventory your existing scope-inversion call sites and spike a native or local macro before adding a dependency.
How do I negate a relationship constraint with whereNot?
The package is designed to invert relationship constraints through the whereNot macro, letting you express the inverse of a whereHas-style constraint more readably. Because negation of relationship constraints can behave subtly, add application-level tests for each relationship case you rely on. Confirm the exact syntax against the package source before adopting it broadly.
Can I use orWhereNot with nested closures?
The package exposes both whereNot and orWhereNot and advertises support for nested closures. Negating orWhere groups and nested constraint groups is one of the higher-risk areas, so test each combination in your own suite. Do not assume correct behavior for complex boolean logic without explicit regression tests.
Does whereNot handle SQL NULL values correctly?
SQL uses three-valued logic, so negating a condition involving NULL does not always produce the result developers expect. The package documentation does not demonstrate verified NULL handling, and the technical assessment flags this as a risk area. Write tests with nullable columns and NULL comparisons before depending on whereNot in production queries.
Is this package safe to use in production?
Treat it as high risk relative to its value. There is no demonstrated security or bug-fix maintenance, no verified test coverage against modern Laravel, and zero dependents providing production evidence. If you need its exact behavior, vendor the small MIT-licensed logic into your application with tests and explicit ownership.
Is protonemedia/laravel-eloquent-where-not still maintained?
Release 1.2.0 is a single one-line compatibility patch adding Laravel 9 support, not evidence of active maintenance or a roadmap. It does not establish a security response process or ongoing bug-fix commitment. Assume the upstream repository may not receive further updates and plan ownership accordingly.
Can I vendor or fork the package instead of depending on it?
Yes. The MIT license permits forking or copying the implementation into an application support class or local query macro. Preserve the MIT attribution if you vendor the code, and add your own tests for orWhere, nested groups, relationships, and NULL behavior. This is the recommended path when the package's exact negation semantics are required long term.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle