class NewsletterPolicy extends CachedPolicy

Traits

HandlesAuthorization

Constants

TIME

Time to store the cached values.

(is irrelevant for the array store)

Properties

protected Repository $cache

The cache instance to use for caching policies.

from  CachedPolicy

Methods

__construct()

Create a new CachedPolicy.

mixed
remember(string $key, callable $callback)

Wrapper for the Cache::remember function of the array cache.

bool
create(User $user)

Determine if the given user can create a newsletter.

bool
access(User|null $user, Newsletter $n)

Determine if the given user can access a newsletter.

bool
update(User $user, Newsletter $n)

Determine if the given user can update a newsletter.

bool
publish(User $user, Newsletter $n)

Determine if the given user can publish a newsletter.

bool
destroy(User $user, Newsletter $n)

Determine if the given user can destroy a newsletter.

Details

in CachedPolicy at line 31
__construct()

Create a new CachedPolicy.

in CachedPolicy at line 43
mixed remember(string $key, callable $callback)

Wrapper for the Cache::remember function of the array cache.

Parameters

string $key

Key of the cached item

callable $callback

Callback returning the cached item

Return Value

mixed

at line 21
bool create(User $user)

Determine if the given user can create a newsletter.

Parameters

User $user

Return Value

bool

at line 34
bool access(User|null $user, Newsletter $n)

Determine if the given user can access a newsletter.

Parameters

User|null $user
Newsletter $n

Return Value

bool

at line 51
bool update(User $user, Newsletter $n)

Determine if the given user can update a newsletter.

Parameters

User $user
Newsletter $n

Return Value

bool

at line 68
bool publish(User $user, Newsletter $n)

Determine if the given user can publish a newsletter.

Parameters

User $user
Newsletter $n

Return Value

bool

at line 85
bool destroy(User $user, Newsletter $n)

Determine if the given user can destroy a newsletter.

Parameters

User $user
Newsletter $n

Return Value

bool