BorNKylleR
BorNKylleR
FFilament
Created by BorNKylleR on 2/2/2024 in #❓┊help
markdown editor
No description
4 replies
FFilament
Created by BorNKylleR on 9/4/2023 in #❓┊help
Only arrays and Traversables can be unpacked
My code is like this:
use Filament\Notifications\Actions\Action;
use Filament\Notifications\Notification;

public function delete(): void
{
Notification::make()
->warning()
->title('Delete confirmation')
->body('Are you sure you want to delete this reply?')
->actions([
Action::make('confirm')
->label('Confirm')
->color('danger')
->button()
->close()
->dispatch('doDelete', [$this->reply->id]),

Action::make('cancel')
->label('Cancel')
->close()
])
->persistent()
->send();
}

public function doDelete(int $reply): void
{
dd($reply);
}
use Filament\Notifications\Actions\Action;
use Filament\Notifications\Notification;

public function delete(): void
{
Notification::make()
->warning()
->title('Delete confirmation')
->body('Are you sure you want to delete this reply?')
->actions([
Action::make('confirm')
->label('Confirm')
->color('danger')
->button()
->close()
->dispatch('doDelete', [$this->reply->id]),

Action::make('cancel')
->label('Cancel')
->close()
])
->persistent()
->send();
}

public function doDelete(int $reply): void
{
dd($reply);
}
After I click on confirm, it gives me the following error: Only arrays and Traversables can be unpacked Where am I wrong? Thank you
16 replies