trait HasGlobalScopes (View source)
| static void | bootHasGlobalScopes()
Boot the has global scopes trait for a model. | |
| static array | resolveGlobalScopeAttributes()
Resolve the global scope class names from the attributes. | |
| static mixed | addGlobalScope(Scope|Closure|string $scope, Scope|Closure|null $implementation = null)
Register a new global scope on the model. | |
| static void | addGlobalScopes(array $scopes)
Register multiple global scopes on the model. | |
| static bool | hasGlobalScope(Scope|string $scope)
Determine if a model has a global scope. | |
| static Scope|Closure|null | getGlobalScope(Scope|string $scope)
Get a global scope registered with the model. | |
| static array | getAllGlobalScopes()
Get all of the global scopes that are currently registered. | |
| static void | setAllGlobalScopes(array $scopes)
Set the current global scopes. | |
| array | getGlobalScopes()
Get the global scopes for this class instance. |
Boot the has global scopes trait for a model.
Resolve the global scope class names from the attributes.
Register a new global scope on the model.
Register multiple global scopes on the model.
Determine if a model has a global scope.
Get a global scope registered with the model.
Get all of the global scopes that are currently registered.
Set the current global scopes.
Get the global scopes for this class instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.html