trait HasGlobalScopes

Methods

static mixed
addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null)

Register a new global scope 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.

array
getGlobalScopes()

Get the global scopes for this class instance.

Details

at line 21
static mixed addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null)

Register a new global scope on the model.

Parameters

Scope|Closure|string $scope
Closure $implementation

Return Value

mixed

Exceptions

InvalidArgumentException

at line 40
static bool hasGlobalScope(Scope|string $scope)

Determine if a model has a global scope.

Parameters

Scope|string $scope

Return Value

bool

at line 51
static Scope|Closure|null getGlobalScope(Scope|string $scope)

Get a global scope registered with the model.

Parameters

Scope|string $scope

Return Value

Scope|Closure|null

at line 67
array getGlobalScopes()

Get the global scopes for this class instance.

Return Value

array