src/Database/Queries/Abilities.php
public static function forAuthority(Model $authority, $allowed = true)
    {
        return Models::ability()->where(function ($query) use ($authority, $allowed) {
            $query->whereExists(static::getRoleConstraint($authority, $allowed));
            $query->orWhereExists(static::getAuthorityConstraint($authority, $allowed));
            $query->orWhereExists(static::getEveryoneConstraint($allowed));
        });
    }
public static function forAuthority(Model $authority, $allowed = true)
    {
        return Models::ability()->where(function ($query) use ($authority, $allowed) {
            $query->whereExists(static::getRoleConstraint($authority, $allowed));
            $query->orWhereExists(static::getAuthorityConstraint($authority, $allowed));
            $query->orWhereExists(static::getEveryoneConstraint($allowed));
        });
    }
public static function forAuthority ( Model $ authority , $ allowed = true ) { return Models :: ability ( ) -> where ( function ( $ query ) use ( $ authority , $ allowed ) { $ query -> whereExists ( static :: getRoleConstraint ( $ authority , $ allowed ) ) ; $ query -> orWhereExists ( static :: getAuthorityConstraint ( $ authority , $ allowed ) ) ; $ query -> orWhereExists ( static :: getEveryoneConstraint ( $ allowed ) ) ; } ) ; }
Get a query for the authority's abilities.

@param  \Illuminate\Database\Eloquent\Model  $authority
@param  bool  $allowed
@return \Illuminate\Database\Eloquent\Builder
Get a query for the authority s abilities .