\App\EloquentAuthorizationAwareModel

An interface for models to give them the ability to scope database queries based on current user authentication.

Summary

Methods
Constants
getPublicScopes()
canUsePublicScope()
validatePublicScopeParams()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getPublicScopes()

getPublicScopes() : array<mixed,string>

Returns a list of scopes that can be used from outside of the app

Returns

array<mixed,string>

canUsePublicScope()

canUsePublicScope(string  $scopeName, \App\User  $user = null) : boolean

Returns whether a certain user can use a particular scope

Parameters

string $scopeName
\App\User $user

Returns

boolean

validatePublicScopeParams()

validatePublicScopeParams(string  $scopeName, array<mixed,string>|\Illuminate\Support\Collection  $columnNames) : boolean

Determines whether the user is allowed to additionally limit his query with provided column names when requesting a particular scope

Parameters

string $scopeName
array<mixed,string>|\Illuminate\Support\Collection $columnNames

Returns

boolean