refactor: Group sub-classification table entries by classification name and set it as the default group.
This commit is contained in:
parent
2b627a649e
commit
29595e86bb
@ -25,6 +25,7 @@
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Filters\TrashedFilter;
|
||||
use Filament\Tables\Grouping\Group;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@ -73,11 +74,6 @@ public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('classification.name')
|
||||
->label('Klasifikasi')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
|
||||
TextColumn::make('name')
|
||||
->label('Nama')
|
||||
->searchable()
|
||||
@ -123,7 +119,13 @@ public static function table(Table $table): Table
|
||||
->emptyStateIcon(Heroicon::QueueList)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('created_at', 'desc')
|
||||
->deferFilters(false);
|
||||
->deferFilters(false)
|
||||
->groups([
|
||||
Group::make('classification.name')
|
||||
->label('Klasifikasi')
|
||||
->collapsible(),
|
||||
])
|
||||
->defaultGroup('classification.name');
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
Loading…
Reference in New Issue
Block a user