F
Filament12mo ago
ruddy

Change the label of all page summary in the table.

I apologize if this has been asked before, but I couldn't find it. Does anyone have an idea of how I can change this name? Here is a screenshot.
No description
7 Replies
jaocero
jaocero12mo ago
->getStateUsing(fn() => 'New Name')
ruddy
ruddyOP12mo ago
ooh it doesn't work
ChesterS
ChesterS12mo ago
What does this do Sum::make()->label('Your label') ?
ruddy
ruddyOP12mo ago
I have attempted the suggested solution, but it seems to change only the label of the column rather than the label of the row. I have attached a screenshot for reference. What I need is for all payments to be labeled as 'All Total.
Tables\Columns\TextColumn::make('total')
->searchable(false)
->summarize(Sum::make()->label('Total')->extraAttributes(['class' => 'font-black'])->money('gbp'))
->money(),
Tables\Columns\TextColumn::make('total')
->searchable(false)
->summarize(Sum::make()->label('Total')->extraAttributes(['class' => 'font-black'])->money('gbp'))
->money(),
ruddy
ruddyOP12mo ago
No description
ChesterS
ChesterS12mo ago
Ok this took some digging but you can change this on the table using ->pluralModelLabel() eg
public static function table(Table $table): Table
{
return $table
->pluralModelLabel('Things');
}
public static function table(Table $table): Table
{
return $table
->pluralModelLabel('Things');
}
it will still say 'All Things' though. This is using tranlsations Not sure how you would override it - check vendor/filament/tables/resources/lang/en/table.php
'subheadings' => [
'all' => 'All :label',
'group' => ':group summary',
'page' => 'This page',
],
'subheadings' => [
'all' => 'All :label',
'group' => ':group summary',
'page' => 'This page',
],
ruddy
ruddyOP12mo ago
Thanks, it works
Want results from more Discord servers?
Add your server