src/Conductors/Concerns/FindsAndCreatesAbilities.php
protected function findAbility($ability, $entity, $attributes)
    {
        $onlyOwned = isset($attributes['only_owned']) ? $attributes['only_owned'] : false;

        $query = Models::ability()
                     ->where('name', $ability)
                     ->forModel($entity, true)
                     ->where('only_owned', $onlyOwned);

        return Models::scope()->applyToModelQuery($query)->first();
    }
protected function findAbility($ability, $entity, $attributes)
    {
        $onlyOwned = isset($attributes['only_owned']) ? $attributes['only_owned'] : false;

        $query = Models::ability()
                     ->where('name', $ability)
                     ->forModel($entity, true)
                     ->where('only_owned', $onlyOwned);

        return Models::scope()->applyToModelQuery($query)->first();
    }
protected function findAbility ( $ ability , $ entity , $ attributes ) { $ onlyOwned = isset ( $ attributes [ 'only_owned' ] ) ? $ attributes [ 'only_owned' ] : false ; $ query = Models :: ability ( ) -> where ( 'name' , $ ability ) -> forModel ( $ entity , true ) -> where ( 'only_owned' , $ onlyOwned ) ; return Models :: scope ( ) -> applyToModelQuery ( $ query ) -> first ( ) ; }
Find the ability for the given entity.

@param  string  $ability
@param  \Illuminate\Database\Eloquent\Model|string  $entity
@param  array  $attributes
@return \Silber\Bouncer\Database\Ability|null
Find the ability for the given entity .