Watheq's avatar
Level 14

How to make laravel pagination pretty instead of query params?

I want to change pagination default from ?page=2 to /page/2

I have tried https://github.com/spatie/laravel-paginateroute but it is archived & used for old Laravel verisons.

How can I implement this?

0 likes
6 replies
Watheq's avatar
Level 14

@MichalOravec

it doesn't work either

I get

Non-static method MichalOravec\PaginateRoute\PaginateRoute::registerMacros() cannot be called statically

when I register the macro in RouteServiceProvider

Watheq's avatar
Level 14

@snapey

after using composer dump the same problem remains..

yes I am using the facade in RouteServiceProvider

public function boot()
    {
        \MichalOravec\PaginateRoute\PaginateRoute::registerMacros();
        parent::boot();
	}
Watheq's avatar
Level 14

the problem in the RouterServerProvider starts even before using the facade

Please or to participate in this conversation.