public function paginateHydrate($result, $modelClass = null)
    {
        // Get values
        $pagination = array_get($result, 'pagination', []);
        $items = array_get($result, 'items', []);
        $page = LengthAwarePaginator::resolveCurrentPage();

        // Set pagination
        $perPage = array_get($pagination, 'perPage', array_get($pagination, 'per_page', 15));
        $total = array_get($pagination, 'total', null);

        // Set options
        $options = is_array($result) ? array_except($result, [
            'pagination',
            'items',
            'next',
            'per_page',
            'last'
        ]) : [];

        return new LengthAwarePaginator($this->hydrate($items, $modelClass), $total, $perPage, $page,
            array_merge($options, [
                'path' => LengthAwarePaginator::resolveCurrentPath()
            ]));
    }