You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in my project, the TextEntry is in a RepeatableEntry. I have multiple products of value and quantity, and I want to display the total price per product row. I cannot get this to work...
Infolists\Components\RepeatableEntry::make('products')->schema([
Infolists\Components\TextEntry::make('value')
->money('EUR'),
Infolists\Components\TextEntry::make('quantity'),
Infolists\Components\TextEntry::make('total') // value * quantity
->money('EUR')
// 1
->state(function($record) {
// $record returns record, but not the repeated row??
})
// 2
->state(function(Infolists\Components\TextEntry$textEntry) {
// $textEntry returns this field, and via ->getContainer() I can access the row$textEntry->getContainer()->getComponents()[0] //value field$textEntry->getContainer()->getComponents()[1] //quantity field// ... but this doesn't feel right, because, what if I change the order of fields? And furthermore, this doesn't feel as readable as filament intended, I think...
}),
])
I can't find any documentation on how to achieve this. I would also be helped if there is somewhere a list of parameters that I can use in the state() function.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Package
Infolist builder
Package Version
v3.2.123
How can we help you?
In this example of filament docs, we can multiply record amount and vat_rate:
Ref: https://filamentphp.com/docs/3.x/infolists/entries/getting-started#calculated-state
But in my project, the TextEntry is in a RepeatableEntry. I have multiple products of value and quantity, and I want to display the total price per product row. I cannot get this to work...
I can't find any documentation on how to achieve this. I would also be helped if there is somewhere a list of parameters that I can use in the
state()
function.Beta Was this translation helpful? Give feedback.
All reactions