ToggleColumn::make('status')
->onColor('success')
->offColor('warning')
->onIcon('heroicon-s-check')
->offIcon('heroicon-s-x-mark')
->label('Status')
->getStateUsing(fn($record): bool => $record->status === 1)
->afterStateUpdated(function ($record, $state, $livewire) {
$record->update(['status' => $state ? 1 : 0]);
Notification::make()
->title('')
->success()
->body('Status updated successfully!')
->send();
$livewire->getTableRecords();
}),
ToggleColumn::make('status')
->onColor('success')
->offColor('warning')
->onIcon('heroicon-s-check')
->offIcon('heroicon-s-x-mark')
->label('Status')
->getStateUsing(fn($record): bool => $record->status === 1)
->afterStateUpdated(function ($record, $state, $livewire) {
$record->update(['status' => $state ? 1 : 0]);
Notification::make()
->title('')
->success()
->body('Status updated successfully!')
->send();
$livewire->getTableRecords();
}),