spodlogar's avatar

Laravel Pagination

How can I use a different paginator in my Laravel view? It seems to default to the Bootstrap 3 Presenter and I would like to use the Bootstrap 4 Presenter.

0 likes
6 replies
d3xt3r's avatar

Create your own instance of presenter (\Illuminate\Contracts\Pagination\Presenter) and pass it to render function ...

spodlogar's avatar

I have like 30 different places I am using the paginator, isn't there a configuration option or something like that where I can just tell Laravel to use the BootstrapFourPresenter by default?

d3xt3r's avatar
d3xt3r
Best Answer
Level 29

I don't think so ... Edit : Never tried myself, but try the below method on paginator , add it AppServiceProvider boot method ...

/**
     * Set the default Presenter resolver.
     *
     * @param  \Closure  $resolver
     * @return void
     */
    public static function presenter(Closure $resolver)
    {
        static::$presenterResolver = $resolver;
    }

spodlogar's avatar

Ok, Thank's for your time. I am going to need to keep digging. : )

spodlogar's avatar

I am happy to say THAT WORKED.

Thank you so much. ; )

Please or to participate in this conversation.