src/CachedClipboard.php
protected function findMatchingAbility($abilities, $applicable, $model, $authority)
    {
        $abilities = $abilities->toBase()->pluck('identifier', 'id');

        if ($id = $this->getMatchedAbilityId($abilities, $applicable)) {
            return $id;
        }

        if ($this->isOwnedBy($authority, $model)) {
            return $this->getMatchedAbilityId(
                $abilities,
                $applicable->map(function ($identifier) {
                    return $identifier.'-owned';
                })
            );
        }
    }
protected function findMatchingAbility($abilities, $applicable, $model, $authority)
    {
        $abilities = $abilities->toBase()->pluck('identifier', 'id');

        if ($id = $this->getMatchedAbilityId($abilities, $applicable)) {
            return $id;
        }

        if ($this->isOwnedBy($authority, $model)) {
            return $this->getMatchedAbilityId(
                $abilities,
                $applicable->map(function ($identifier) {
                    return $identifier.'-owned';
                })
            );
        }
    }
protected function findMatchingAbility ( $ abilities , $ applicable , $ model , $ authority ) { $ abilities = $ abilities -> toBase ( ) -> pluck ( 'identifier' , 'id' ) ; if ( $ id = $ this -> getMatchedAbilityId ( $ abilities , $ applicable ) ) { return $ id ; } if ( $ this -> isOwnedBy ( $ authority , $ model ) ) { return $ this -> getMatchedAbilityId ( $ abilities , $ applicable -> map ( function ( $ identifier ) { return $ identifier . '-owned' ; } ) ) ; } }
Determine if any of the abilities can be matched against the provided applicable ones.

@param  \Illuminate\Support\Collection  $abilities
@param  \Illuminate\Support\Collection  $applicable
@param  \Illuminate\Database\Eloquent\Model  $model
@param  \Illuminate\Database\Eloquent\Model  $authority
@return int|null
Determine if any of the abilities can be matched against the provided applicable ones .