protected function collectResource($resource)
    {
        if ($resource instanceof MissingValue) {
            return $resource;
        }

        $collects = $this->collects();

        $this->collection = $collects && ! $resource->first() instanceof $collects
            ? $resource->mapInto($collects)
            : $resource->toBase();

        return $resource instanceof AbstractPaginator
                    ? $resource->setCollection($this->collection)
                    : $this->collection;
    }
protected function collectResource($resource)
    {
        if ($resource instanceof MissingValue) {
            return $resource;
        }

        $collects = $this->collects();

        $this->collection = $collects && ! $resource->first() instanceof $collects
            ? $resource->mapInto($collects)
            : $resource->toBase();

        return $resource instanceof AbstractPaginator
                    ? $resource->setCollection($this->collection)
                    : $this->collection;
    }
protected function collectResource ( $ resource ) { if ( $ resource instanceof MissingValue ) { return $ resource ; } $ collects = $ this -> collects ( ) ; $ this -> collection = $ collects && ! $ resource -> first ( ) instanceof $ collects ? $ resource -> mapInto ( $ collects ) : $ resource -> toBase ( ) ; return $ resource instanceof AbstractPaginator ? $ resource -> setCollection ( $ this -> collection ) : $ this -> collection ; }
Map the given collection resource into its individual resources.

@param  mixed  $resource
@return mixed
Map the given collection resource into its individual resources .