Skip to content

Commit

Permalink
feat(ListNotifyThemes): add support for Filament Tables and enable so…
Browse files Browse the repository at this point in the history
…rting, filtering, and bulk actions
  • Loading branch information
Malebestia committed Dec 11, 2024
1 parent de731a6 commit 96baacb
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions Filament/Resources/NotifyThemeResource/Pages/ListNotifyThemes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Modules\Notify\Filament\Resources\NotifyThemeResource\Pages;

use Filament\Tables\Table;
use Modules\UI\Enums\TableLayoutEnum;
use Filament\Pages\Actions\CreateAction;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Modules\Xot\Filament\Pages\XotBaseListRecords;
use Modules\Notify\Filament\Resources\NotifyThemeResource;
Expand All @@ -18,10 +20,35 @@ class ListNotifyThemes extends XotBaseListRecords



protected function getHeaderActions(): array
// protected function getHeaderActions(): array
// {
// return [
// CreateAction::make(),
// ];
// }

public function table(Table $table): Table
{
return $table
->columns($this->getTableColumns())
->filters($this->getTableFilters())
->actions($this->getTableActions())
->bulkActions($this->getTableBulkActions())
->headerActions($this->getTableHeaderActions())
// ->defaultSort('pos', 'asc')
// ->reorderable('pos')
;
}

public function getTableColumns(): array
{
return [
CreateAction::make(),
TextColumn::make('id')->sortable(),
TextColumn::make('lang')->sortable(),
TextColumn::make('type')->sortable(),
// TextColumn::make('post_id')->sortable(),
// TextColumn::make('post_type')->sortable(),
TextColumn::make('logo_src')->sortable(),
];
}
}

0 comments on commit 96baacb

Please sign in to comment.