src/Conductors/Concerns/FindsAndCreatesAbilities.php
protected function getAbilityIdsFromArray($abilities, array $attributes)
    {
        $groups = Helpers::groupModelsAndIdentifiersByType($abilities);

        $keyName = Models::ability()->getKeyName();

        $groups['strings'] = $this->abilitiesByName($groups['strings'], $attributes)
                                  ->pluck($keyName)->all();

        $groups['models'] = Arr::pluck($groups['models'], $keyName);

        return Arr::collapse($groups);
    }
protected function getAbilityIdsFromArray($abilities, array $attributes)
    {
        $groups = Helpers::groupModelsAndIdentifiersByType($abilities);

        $keyName = Models::ability()->getKeyName();

        $groups['strings'] = $this->abilitiesByName($groups['strings'], $attributes)
                                  ->pluck($keyName)->all();

        $groups['models'] = Arr::pluck($groups['models'], $keyName);

        return Arr::collapse($groups);
    }
protected function getAbilityIdsFromArray ( $ abilities , array $ attributes ) { $ groups = Helpers :: groupModelsAndIdentifiersByType ( $ abilities ) ; $ keyName = Models :: ability ( ) -> getKeyName ( ) ; $ groups [ 'strings' ] = $ this -> abilitiesByName ( $ groups [ 'strings' ] , $ attributes ) -> pluck ( $ keyName ) -> all ( ) ; $ groups [ 'models' ] = Arr :: pluck ( $ groups [ 'models' ] , $ keyName ) ; return Arr :: collapse ( $ groups ) ; }
Get the ability IDs from the provided array, creating the ones that don't exist.

@param  iterable  $abilities
@param  array  $attributes
@return array
Get the ability IDs from the provided array creating the ones that don t exist .