F
Filamentβ€’9mo ago
Noxo

Pagination inside modal

Any idea how to implement pagination inside modal? It would be ideal to implement infinite scrolling, but this is still a dream. i tried a way with pagination component but got redirect to - https://demo.test/livewire/update?page=3 with error: The GET method is not supported for route livewire/update. Supported methods: POST. My code: Action class
class StockHistory extends Action
{
public static function getDefaultName(): ?string
{
return 'stock-history';
}

protected function setUp(): void
{
parent::setUp();

$this->label(__('admin.actions.stock_history.label'));
$this->modalHeading(__('admin.actions.stock_history.heading'));
$this->slideOver();
$this->modalSubmitAction(false);
$this->modalCancelAction(false);
$this->color(ColorService::blue());
$this->modalWidth(MaxWidth::Medium);
$this->modalContent(function ($record): View {
$history = $record->stockHistory()->paginate(4);

return view('filament.stock-history', ['history' => $history]);
});
}
}
class StockHistory extends Action
{
public static function getDefaultName(): ?string
{
return 'stock-history';
}

protected function setUp(): void
{
parent::setUp();

$this->label(__('admin.actions.stock_history.label'));
$this->modalHeading(__('admin.actions.stock_history.heading'));
$this->slideOver();
$this->modalSubmitAction(false);
$this->modalCancelAction(false);
$this->color(ColorService::blue());
$this->modalWidth(MaxWidth::Medium);
$this->modalContent(function ($record): View {
$history = $record->stockHistory()->paginate(4);

return view('filament.stock-history', ['history' => $history]);
});
}
}
Template file
{{ $history }}

<x-filament::pagination :paginator="$history" />
{{ $history }}

<x-filament::pagination :paginator="$history" />
Solution:
Nuno Maduro (@enunomaduro) on X
Livewire Infinite Scrolling. 🀌🏻
From An unknown user
Twitter
Jump to solution
1 Reply
Solution
Noxo
Noxoβ€’9mo ago
Nuno Maduro (@enunomaduro) on X
Livewire Infinite Scrolling. 🀌🏻
From An unknown user
Twitter
Want results from more Discord servers?
Add your server