src/Database/Concerns/IsRole.php
public function findOrCreateRoles($roles)
    {
        $roles = Helpers::groupModelsAndIdentifiersByType($roles);

        $roles['integers'] = $this->find($roles['integers']);

        $roles['strings'] = $this->findOrCreateRolesByName($roles['strings']);

        return $this->newCollection(Arr::collapse($roles));
    }
public function findOrCreateRoles($roles)
    {
        $roles = Helpers::groupModelsAndIdentifiersByType($roles);

        $roles['integers'] = $this->find($roles['integers']);

        $roles['strings'] = $this->findOrCreateRolesByName($roles['strings']);

        return $this->newCollection(Arr::collapse($roles));
    }
public function findOrCreateRoles ( $ roles ) { $ roles = Helpers :: groupModelsAndIdentifiersByType ( $ roles ) ; $ roles [ 'integers' ] = $ this -> find ( $ roles [ 'integers' ] ) ; $ roles [ 'strings' ] = $ this -> findOrCreateRolesByName ( $ roles [ 'strings' ] ) ; return $ this -> newCollection ( Arr :: collapse ( $ roles ) ) ; }
Find the given roles, creating the names that don't exist yet.

@param  iterable  $roles
@return \Illuminate\Database\Eloquent\Collection
Find the given roles creating the names that don t exist yet .