protected function normalize($object)
    {
        // If its a paginator instance, create a collection with its items.
        if ($object instanceof Paginator) {
            return collect($object->items());
        } elseif (is_array($object)) {
            // If its an array, package it in a collection.
            return collect($object);
        }

        return $object;
    }
protected function normalize($object)
    {
        // If its a paginator instance, create a collection with its items.
        if ($object instanceof Paginator) {
            return collect($object->items());
        } elseif (is_array($object)) {
            // If its an array, package it in a collection.
            return collect($object);
        }

        return $object;
    }
protected function normalize ( $ object ) { // If its a paginator instance, create a collection with its items. if ( $ object instanceof Paginator ) { return collect ( $ object -> items ( ) ) ; } elseif ( is_array ( $ object ) ) { // If its an array, package it in a collection. return collect ( $ object ) ; } return $ object ; }
Normalizes the object to a collection if it is some sort of a container to multiple items.

@param $object
@return Collection
Normalizes the object to a collection if it is some sort of a container to multiple items .