Edit Resource Delete Header Action not showing up.

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make('Delete me'),
Actions\Action::make('Cancel Subscription')->action(function(){

/// custom stuff

})
];
}
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make('Delete me'),
Actions\Action::make('Cancel Subscription')->action(function(){

/// custom stuff

})
];
}
The cancel button is showing but the delete button isn't, Not sure why?
4 Replies
Tim van Heugten
Tim van Heugten3mo ago
Maybe policy related?
awcodes
awcodes3mo ago
Can’t tell on my phone, but are there spaces in the make(), the value provided there is used as a key for the actions in the livewire component and have to be unique. Just thinking maybe it’s being read as “delete” instead of “delete_me” and depending where you are using it there might already be an action cached with the “delete” identifier. Try just DeleteAction::make() without the arguments
thedangler
thedanglerOP3mo ago
I made it delete me just in case it was showing somwhere else, I was trying to track it. But maybe it is policy related. Didn't think of that.
awcodes
awcodes3mo ago
Yea, policy is more likely.

Did you find this page helpful?