jestins's avatar

Pagination issue in Laravel 5.3

When I try to render pagination getting this error.

ErrorException in AbstractPaginator.php line 377: call_user_func() expects parameter 1 to be a valid callback, no array or string given (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php) (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php) (View: C:\xampp\htdocs\project\resources\views\pages\app\file.blade.php)

Here is my code

        if(empty($items)){
            return [];
        }
        $options['path'] = route('test');
        $options['query'] = ['id' => 5];
        $page = $page ?: (Paginator::resolveCurrentPage() ?: 1);
        $items = $items instanceof Collection ? $items : Collection::make($items);
        return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options);
0 likes
1 reply
jestins's avatar
jestins
OP
Best Answer
Level 1

I fixed the issue, Issue is with config cache:

php artisan config:cache fixed the issue

Hope it helps for some one.

Please or to participate in this conversation.