Weave Code
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 Global Or Scope Laravel Package

lacodix/laravel-global-or-scope

Add multiple Eloquent global scopes that are grouped and applied with OR logic instead of the default AND. Use a simple trait to register OR-scopes and optionally disable some or all of them per query with withoutGlobalOrScopes().

View on GitHub
Deep Wiki
Context7

title: Disable Global Or Scopes weight: 2

It is possible to disable/remove the global or scopes for single queries.

Disable one scope

If you want to disable one of your or combined global scopes, you can just use the withoutGlobalOrScope method on the current query builder.

Post::query()->withoutGlobalOrScope(Scope1::class)->get();

Disable all scopes

you can also disable all global or scopes at once.

Post::query()->withoutGlobalOrScopes()->get();

Get the disabled scopes

if you need to know which scopes have been disabled you get it like so:

Post::query()->removedOrScopes();

Disable all scopes for the whole request

If you want to disable all global scopes for the whole request, just call

Post::clearGlobalOrScopes();
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours