private function getIdsWithAttributes($id, $attributes = [])
    {
        $ids = [];

        if ($id instanceof Model) {
            $ids[$id->getKey()] = $attributes;
        } elseif ($id instanceof Collection) {
            foreach ($id as $model) {
                $ids[$model->getKey()] = $attributes;
            }
        } elseif (is_array($id)) {
            foreach ($id as $key => $attributesArray) {
                if (is_array($attributesArray)) {
                    $ids[$key] = array_merge($attributes, $attributesArray);
                } else {
                    $ids[$attributesArray] = $attributes;
                }
            }
        } elseif (is_int($id) || is_string($id)) {
            $ids[$id] = $attributes;
        }

        $idsOnly = array_keys($ids);

        return [$idsOnly, $ids];
    }
private function getIdsWithAttributes($id, $attributes = [])
    {
        $ids = [];

        if ($id instanceof Model) {
            $ids[$id->getKey()] = $attributes;
        } elseif ($id instanceof Collection) {
            foreach ($id as $model) {
                $ids[$model->getKey()] = $attributes;
            }
        } elseif (is_array($id)) {
            foreach ($id as $key => $attributesArray) {
                if (is_array($attributesArray)) {
                    $ids[$key] = array_merge($attributes, $attributesArray);
                } else {
                    $ids[$attributesArray] = $attributes;
                }
            }
        } elseif (is_int($id) || is_string($id)) {
            $ids[$id] = $attributes;
        }

        $idsOnly = array_keys($ids);

        return [$idsOnly, $ids];
    }
private function getIdsWithAttributes ( $ id , $ attributes = [ ] ) { $ ids = [ ] ; if ( $ id instanceof Model ) { $ ids [ $ id -> getKey ( ) ] = $ attributes ; } elseif ( $ id instanceof Collection ) { foreach ( $ id as $ model ) { $ ids [ $ model -> getKey ( ) ] = $ attributes ; } } elseif ( is_array ( $ id ) ) { foreach ( $ id as $ key => $ attributesArray ) { if ( is_array ( $ attributesArray ) ) { $ ids [ $ key ] = array_merge ( $ attributes , $ attributesArray ) ; } else { $ ids [ $ attributesArray ] = $ attributes ; } } } elseif ( is_int ( $ id ) || is_string ( $ id ) ) { $ ids [ $ id ] = $ attributes ; } $ idsOnly = array_keys ( $ ids ) ; return [ $ idsOnly , $ ids ] ; }
Cleans the ids and ids with attributes
Returns an array with and array of ids and array of id => attributes.

@param mixed $id
@param array $attributes

@return array
Cleans the ids and ids with attributes Returns an array with and array of ids and array of id = > attributes .