feat: Enhance visitor resource filters with improved date pickers and non-native selects, and configure table empty state, default sorting, and filter deferral.
This commit is contained in:
parent
15024705e0
commit
829b857ce9
@ -76,12 +76,22 @@ public static function table(Table $table): Table
|
||||
->options([
|
||||
'GET' => 'GET',
|
||||
'POST' => 'POST',
|
||||
]),
|
||||
])
|
||||
->native(false),
|
||||
|
||||
Filter::make('date')
|
||||
->schema([
|
||||
DatePicker::make('from')->time()->autocomplete(false),
|
||||
DatePicker::make('until')->time()->autocomplete(false),
|
||||
DatePicker::make('from')
|
||||
->label('Dari')
|
||||
->placeholder('Pilih Tanggal')
|
||||
->displayFormat('l, d F Y')
|
||||
->native(false),
|
||||
|
||||
DatePicker::make('until')
|
||||
->label('Sampai')
|
||||
->placeholder('Pilih Tanggal')
|
||||
->displayFormat('l, d F Y')
|
||||
->native(false),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query
|
||||
@ -89,8 +99,10 @@ public static function table(Table $table): Table
|
||||
->when($data['until'], fn (Builder $q): Builder => $q->whereDate('date', '<=', $data['until']));
|
||||
}),
|
||||
])
|
||||
->recordActions([])
|
||||
->toolbarActions([]);
|
||||
->emptyStateIcon(Heroicon::ChartBar)
|
||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||
->defaultSort('date', 'desc')
|
||||
->deferFilters(false);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
||||
Loading…
Reference in New Issue
Block a user