filament/filament
^3.2
^11.9
^3.0
^8.2
I have togglecolumn on table. when
ToggleColumn::make( 'confirmed' )
->label( 'Confirmed' )
->updateStateUsing( function ($record, $state): bool {
$user = auth()->user();
if ($user->hasRole( 'admin' )) {
return $state; // Confirm toggle on success
} else {
Notification::make()
->title( 'Action Blocked' )
->body( 'You do not have permission to change this status.' )
->color( 'danger' )
->warning()
->send();
throw ValidationException::withMessages( [] );
}
} ),
if the togglecolumn is currently false, when toggle from false to true, if the condition didn't meet, the toggle stay at false.
the problem is
if the togglecolumn is currently true, when toggle from true to false, if the condition didnt meet, the toggle will still move to false. if refresh the page, the toggle will show true again.
when condition not met, the toggle should stay at original state.
https://github.com/Sze-Huang/filament-togglecolumn-issue
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too