finished the upgrade to filament 4. completely revamped the frontend with codex, now it looks great!
This commit is contained in:
52
app/Filament/Resources/Users/Pages/ListUsers.php
Normal file
52
app/Filament/Resources/Users/Pages/ListUsers.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\UserResource\Pages;
|
||||
|
||||
use App\Filament\Resources\UserResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Illuminate\Contracts\Pagination\Paginator;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ListUsers extends ListRecords
|
||||
{
|
||||
protected static string $resource = UserResource::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 'users-table';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user