trait ScopeVisibilityTrait

Properties

static protected $visibilityScopers

Methods

static void
registerVisibilityScoper(callable $scoper, string|null $ability = null)

No description

Builder
scopeWhereVisibleTo(Builder $query, User $actor, string $ability = 'view')

<p>Scope a query to only include records that are visible to a user.</p>

static Builder
whereVisibleTo(User $user)

No description

Details

static void registerVisibilityScoper(callable $scoper, string|null $ability = null)

Parameters

callable $scoper
string|null $ability

Return Value

void

Builder scopeWhereVisibleTo(Builder $query, User $actor, string $ability = 'view')

<p>Scope a query to only include records that are visible to a user.</p>

Parameters

Builder $query
User $actor
string $ability

Return Value

Builder

static Builder whereVisibleTo(User $user)

Parameters

User $user

Return Value

Builder