You could define a new Action.
php artisan nova:action DeleteModel so then in the handle method you could add the delete action
public function handle(ActionFields $fields, Collection $models)
{
foreach($models as $model){
//Your custom logic before delete
$model->delete(); //->softDelete()
//if the deletion fails then return a Action::danger('Message');
}
return Action::message('Deleted!');
}
In the nova Model add the new DeleteModel action in the actions() method.
Do not forget to remove the delete button from the default actions.
so then if you need for this action some additional information you could add this in the fields() method in the DeleteModel.
Have a look at this video - https://laracasts.com/series/laravel-nova-mastery/episodes/10