src/Support/Serializer.php
final protected function serializeBasicDataset($dataset): array
    {
        $key = $this->resolveSerializerKey($dataset);

        if ($dataset instanceof Paginator) {
            $collection = $dataset->toArray();

            $collection[$key] = $collection['data'];
            unset($collection['data']);

            return $collection;
        }

        return [
            $key => $dataset->toArray(),
        ];
    }
final protected function serializeBasicDataset($dataset): array
    {
        $key = $this->resolveSerializerKey($dataset);

        if ($dataset instanceof Paginator) {
            $collection = $dataset->toArray();

            $collection[$key] = $collection['data'];
            unset($collection['data']);

            return $collection;
        }

        return [
            $key => $dataset->toArray(),
        ];
    }
final protected function serializeBasicDataset ( $ dataset ) : array { $ key = $ this -> resolveSerializerKey ( $ dataset ) ; if ( $ dataset instanceof Paginator ) { $ collection = $ dataset -> toArray ( ) ; $ collection [ $ key ] = $ collection [ 'data' ] ; unset ( $ collection [ 'data' ] ) ; return $ collection ; } return [ $ key => $ dataset -> toArray ( ) , ] ; }
Resolve paginated dataset.

@param  mixed  $dataset

@return array
Resolve paginated dataset .