Spec-Zone.ru › Laravel 8

HasGlobalScopes

trait HasGlobalScopes (View source)

Methods

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

Зарегистрировать новый глобальный scope для модели.

static bool hasGlobalScope(Scope|string $scope)

Определить, имеет ли модель глобальный scope.

static Scope|Closure|null getGlobalScope(Scope|string $scope)

Получить зарегистрированный глобальный scope модели.

array getGlobalScopes()

Получить глобальные scopes для данного экземпляра класса.

Details

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

Зарегистрировать новый глобальный scope для модели.

Parameters

Scope|Closure|string $scope
Closure $implementation

Return Value

mixed

Exceptions

InvalidArgumentException

static bool hasGlobalScope(Scope|string $scope)

Определить, имеет ли модель глобальный scope.

Parameters

Scope|string $scope

Return Value

bool

static Scope|Closure|null getGlobalScope(Scope|string $scope)

Получить зарегистрированный глобальный scope модели.

Parameters

Scope|string $scope

Return Value

Scope|Closure|null

array getGlobalScopes()

Получить глобальные scopes для данного экземпляра класса.

Return Value

array

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API