12 Replies
Hello members any help
public function getPriceDifferenceAttribute()
{
return $this->price - $this->price2;
}
in your model
Tables\Columns\TextColumn::make('price_difference')
->label('Price Difference'),
in your table
You can also use a virtual column:
https://filamentphp.com/docs/3.x/forms/fields/checkbox-list#customizing-the-relationship-option-labels
thank you
virtual column look better
looks
I cant find any information about a virtual column
first one works but the second one is giving me challenges
Did you create the migration and add this column?
What is the issue?
no
it a dynamic field
but the first solution works fine
just wanted to try out the second option
Are you using mysql?
Yeah
Create a migration to your table and add this
Then, you can use this virtual column as a column in you app
thank you