Custom Table Values

Hey, I have a List table view here, and my entity (model) doesn't actually have the values .. they're in another table. I need to control the point where it grabs the value. I saw on the v1.0 docs (accidentally landed there) that we can do Column->getValueUsing(), which I thought might have been right, but i'm on v3 now. Here is the code I was trying, before I discovered getValueUsing() is deprecated technique
php
return $table
->columns([

TextColumn::make('name')
->searchable(),
Column::make('benefits')
->label('Benefits')
->getValueUsing($callback = fn($record) => $this->getBenefitsTextFromIngredient($record)),
php
return $table
->columns([

TextColumn::make('name')
->searchable(),
Column::make('benefits')
->label('Benefits')
->getValueUsing($callback = fn($record) => $this->getBenefitsTextFromIngredient($record)),
3 Replies
Lara Zeus
Lara Zeus4w ago
use ->state()
pauldragoonis
pauldragoonis4w ago
Hey @Lara Zeus Got a link to using this? Ideally when the data is coming from another Model / DB table I got it @Lara Zeus thanks
pauldragoonis
pauldragoonis4w ago
No description
Want results from more Discord servers?
Add your server