Skip to content

Instantly share code, notes, and snippets.

@allanphilipbarku
Created October 8, 2022 10:05
Show Gist options
  • Save allanphilipbarku/b92948f66c4a76d77e58240c9b0ebfa4 to your computer and use it in GitHub Desktop.
Save allanphilipbarku/b92948f66c4a76d77e58240c9b0ebfa4 to your computer and use it in GitHub Desktop.

how to prevent delete record when have a child record ?

DeleteAction::make()->hidden(fn ($record) => $record->childRelationship()->exists())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment