53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\StyleResource\Pages;
|
|
|
|
use App\Filament\Resources\StyleResource;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\ListRecords;
|
|
use Illuminate\Contracts\Pagination\Paginator;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class ListStyles extends ListRecords
|
|
{
|
|
protected static string $resource = StyleResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\CreateAction::make(),
|
|
];
|
|
}
|
|
|
|
protected function shouldPersistTableFiltersInSession(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function shouldPersistTableSortInSession(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function shouldPersistTableSearchInSession(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected function paginateTableQuery(Builder $query): Paginator
|
|
{
|
|
$paginator = parent::paginateTableQuery($query);
|
|
return $paginator;
|
|
}
|
|
|
|
public function updatedTablePage($page)
|
|
{
|
|
$this->dispatch('table-pagination-updated', ['tableId' => $this->id, 'page' => $page]);
|
|
}
|
|
|
|
protected function getTableQueryStringIdentifier(): ?string
|
|
{
|
|
return 'styles-table';
|
|
}
|
|
}
|