RoyGoode's avatar

changing resource controller to livewire component

I'm using Laravel blade system only for admin panel,so how to change all resource controller,routes and blades to livewire component? and is this necessary?

There is an issue in this case :

livewire overwrite the default pagination of laravel and because we use bootstrap css and blade system for admin panel, default pagination gets the tailwind css with bad style.

0 likes
1 reply
srasch's avatar

You can use bootstrap pagination:



class ShowPosts extends Component
{
    use WithPagination;

    protected $paginationTheme = 'bootstrap';

...or even a custom pagination:



class ShowPosts extends Component
{
    use WithPagination;

    ...

    public function paginationView()
    {
        return 'custom-pagination-links-view';
    }

    ...
}

<div>
    @foreach ($posts as $post)
        ...
    @endforeach

    {{ $posts->links('custom-pagination-links-view') }}
</div>

If you need more information about it, check the docs https://laravel-livewire.com/docs/2.x/pagination

Please or to participate in this conversation.