How call a function from SelectColumn in table?
Hello, how can I call a function from SelectColumn in table?

14 Replies
I think there is an updateStateUsing()
Is there an example in the doc? I saw this, I don't know if it is this https://filamentphp.com/docs/2.x/forms/advanced#updates I would like to call this method that I attach capture

it give me error...


Select is not a SelectColumn, they have different methods
Please try with updateStateUsing()
ok and without ->reactive() ?
yes
Unable to resolve dependency [Parameter #1 [ <required> callable $set ]] in class
->updateStateUsing(function ($state, callable $set) {
dd($set);
I tried dd with $state also but same error
you dont need to $set
you need to update the $record
like you would in laravel
$record->update['col1' => $state, 'col2' => dependant calculated value here]
ok thanks....can I call a function that I've in EditResource?
i dont understand
so as not to have to repeat all that code when changing in the select

when I change the select I've to do all you can see there
extract it into an action class or a method on your model
theres no need to copy code, just use PHP to make an abstraction
ok thanks