onEachSide(2) in pagination not working for me in Laravel 5.8

Posted 3 months ago by Robert_B

This is my first post, hello everybody.

Today I have a problem with settings pagination I still get all links :(.

My controller

    $fundations = Fundation::orderBy('id', 'desc')->paginate(1);
    return view('admin.fundation.index', ['fundations' => $fundations]);

My view

{{ $fundations->onEachSide(3)->links() }} <!-- simple version not working to --> 
{!! $fundations->appends(request()->input())->onEachSide(3)->links('vendor.pagination.default') !!}

My result

1 2 >3< 4 5 6 7 8 9 10 11 12

My expected result (but not working)

1 2 >3< 4 5

Please help

Please sign in or create an account to participate in this conversation.