Skip to content

Commit

Permalink
Completes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
afonic committed Apr 17, 2024
1 parent 207ed8b commit 6448fd0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Http/Livewire/LivewireCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Reach\StatamicLivewireFilters\Http\Livewire;

use Jonassiewertsen\Livewire\WithPagination;
use Livewire\Attributes\Locked;
use Livewire\Attributes\On;
use Livewire\Component;
Expand All @@ -11,7 +10,7 @@

class LivewireCollection extends Component
{
use Hookable, Traits\GenerateParams, Traits\HandleParams, WithPagination;
use Hookable, Traits\GenerateParams, Traits\HandleParams, Traits\WithPagination;

public $params;

Expand Down
17 changes: 17 additions & 0 deletions src/Http/Livewire/Traits/WithPagination.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Reach\StatamicLivewireFilters\Http\Livewire\Traits;

trait WithPagination
{
use \Livewire\WithPagination;

public function withPagination($key, $paginator): array
{
return [
$key => $paginator->items(),
'links' => $paginator->render(),
'pagination_total' => $paginator->total(),
];
}
}

0 comments on commit 6448fd0

Please sign in to comment.