Action in ToggleColumn
Hi. I have the following code in a table of a resource:
Tables\Columns\ToggleColumn::make('is_premium')
->searchable()
->sortable()
->action(
function(User $record) {
dd($record);
}
),
What I want to achieve is that when I click on the cell, the function inside ->action() is triggered to implement additional logic of the column value change.
It only works if I change the column type to TextColumn, but with ToggleColumn nothing happens.
Any idea? thanks4 Replies
You can use
updateStateUsing()
I got
Method Filament\Tables\Columns\ToggleColumn::updateStateUsing does not exist
Is this way correct?
Tables\Columns\ToggleColumn::make('is_premium')
->searchable()
->sortable()
->updateStateUsing(function($state, $record) {
dd($state, $record);
}
),
I'm using filament 2.16GitHub
filament/packages/tables/src/Columns/Concerns/CanUpdateState.php at...
Admin panel, form builder and table builder for Laravel. Built with the TALL stack. Designed for humans. - filament/packages/tables/src/Columns/Concerns/CanUpdateState.php at 2.x · filamentphp/fila...
Hi, I need to add a resource for my taggables table which I need to use to approve or deny the service as locked or unlocked, please let me know how do I do that without the model?