-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request]: Mountable Record Action for record #22
Comments
I'm thinking of integrating actions for v3. |
Hi, I was looking for a way to delete a record, is it currently possible? Or maybe through the edit modal? |
@CharlieEtienne Yes, it's not super elegant, but you can do it in the edit modal like this: use Filament\Forms\Components\Actions;
use Filament\Forms\Components\Actions\Action;
protected function getEditModalFormSchema(?int $recordId): array
{
return [
Actions::make([
Action::make('delete')
->icon('heroicon-m-x-mark')
->color('danger')
->requiresConfirmation()
->action(function () use ($recordId) {
static::$model::find($recordId)->delete();
$this->dispatch('close-modal', id: 'kanban--edit-record-modal');
}),
]),
];
} Hopefully I'll create more elegant ways of doing this in v3. |
Thanks, it's working. |
What happened?
Would be awesome to be able to add actions(e.g. tableactions) to the View
This way would be maybe doable to add comment functionality through a package like this
https://github.com/parallax/filament-comments
I tried to make it working, but am failing to implement it in a clean way..
How to reproduce the bug
Package Version
2.6.1
PHP Version
8.3
Laravel Version
10.0
Which operating systems does with happen with?
No response
Which browsers does with happen with?
No response
Notes
No response
The text was updated successfully, but these errors were encountered: