src/Conductors/Concerns/FindsAndCreatesAbilities.php
protected function abilitiesByName($abilities, $attributes = [])
    {
        $abilities = array_unique(is_array($abilities) ? $abilities : [$abilities]);

        if (empty($abilities)) {
            return new Collection;
        }

        $existing = Models::ability()->simpleAbility()->whereIn('name', $abilities)->get();

        return $existing->merge($this->createMissingAbilities(
            $existing, $abilities, $attributes
        ));
    }
protected function abilitiesByName($abilities, $attributes = [])
    {
        $abilities = array_unique(is_array($abilities) ? $abilities : [$abilities]);

        if (empty($abilities)) {
            return new Collection;
        }

        $existing = Models::ability()->simpleAbility()->whereIn('name', $abilities)->get();

        return $existing->merge($this->createMissingAbilities(
            $existing, $abilities, $attributes
        ));
    }
protected function abilitiesByName ( $ abilities , $ attributes = [ ] ) { $ abilities = array_unique ( is_array ( $ abilities ) ? $ abilities : [ $ abilities ] ) ; if ( empty ( $ abilities ) ) { return new Collection ; } $ existing = Models :: ability ( ) -> simpleAbility ( ) -> whereIn ( 'name' , $ abilities ) -> get ( ) ; return $ existing -> merge ( $ this -> createMissingAbilities ( $ existing , $ abilities , $ attributes ) ) ; }
Get or create abilities by their name.

@param  array|string  $abilities
@param  array  $attributes
@return \Illuminate\Support\Collection
Get or create abilities by their name .