DEV Community


Posted on

override delete button on laravel nova crud

to override delete button on nova add this to model class

public function delete()
    $this->setKeysForSaveQuery($this->newModelQuery())->update(['active' => false]);
    return true;
Enter fullscreen mode Exit fullscreen mode

this will make delete button to update active field instead of delete it.

Top comments (1)

brojenuel profile image
Jenuel Oras Ganawed

how about the update button?