Mikeyer
Mikeyer
FFilament
Created by Mikeyer on 11/13/2023 in #❓┊help
Summarize table without summarizing groups
Hello everyone, I would like summaries at the bottom of my table, but not inline with each group. Is it possible to switch of the summaries for the group rows and show just one summary at the bottom of the table?
return $table
->recordTitleAttribute(fn (JournalEntry $journalEntry): string => $journalEntry->commonDescription?->description ?: $journalEntry->description)
->modifyQueryUsing(fn (Builder $query) => $query->with('commonDescription', 'taxAccount'))
->defaultGroup('taxAccount.name')
->groups([
Group::make('taxAccount.name')
->getTitleFromRecordUsing(fn (JournalEntry $record): string => "[{$record->taxAccount->code}] {$record->taxAccount->name}"),
])
->columns([
Tables\Columns\TextColumn::make('description')
->state(fn (JournalEntry $journalEntry): string => $journalEntry->commonDescription?->description ?: $journalEntry->description),
Tables\Columns\TextColumn::make('debit')
->money('GBP')
->summarize(Sum::make()->money('GBP')),
Tables\Columns\TextColumn::make('credit')
->money('GBP')
->summarize(Sum::make()->money('GBP')),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
return $table
->recordTitleAttribute(fn (JournalEntry $journalEntry): string => $journalEntry->commonDescription?->description ?: $journalEntry->description)
->modifyQueryUsing(fn (Builder $query) => $query->with('commonDescription', 'taxAccount'))
->defaultGroup('taxAccount.name')
->groups([
Group::make('taxAccount.name')
->getTitleFromRecordUsing(fn (JournalEntry $record): string => "[{$record->taxAccount->code}] {$record->taxAccount->name}"),
])
->columns([
Tables\Columns\TextColumn::make('description')
->state(fn (JournalEntry $journalEntry): string => $journalEntry->commonDescription?->description ?: $journalEntry->description),
Tables\Columns\TextColumn::make('debit')
->money('GBP')
->summarize(Sum::make()->money('GBP')),
Tables\Columns\TextColumn::make('credit')
->money('GBP')
->summarize(Sum::make()->money('GBP')),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
1 replies
FFilament
Created by Mikeyer on 8/23/2023 in #❓┊help
Customising header actions on Resource List page
Hello! Newbie here, dumb question incoming. I feel like i'm missing something in the documentation; I want to customise the button in the header of a Resource List page (remove the Create button and add actions of my own however getHeaderActions() on a Resource class doesn't seem to work.
5 replies