DeleteAction::make('delete')
->before(function (TrendRadarTrendSegment $record) {
if ($record->radarTrends()->count() > 0) {
Notification::make()
->title('Delete failed')
->body(__('This segment is used by trends and cannot be deleted. Please move the trends to another segment first.'))
->danger()
->send();
}
})
DeleteAction::make('delete')
->before(function (TrendRadarTrendSegment $record) {
if ($record->radarTrends()->count() > 0) {
Notification::make()
->title('Delete failed')
->body(__('This segment is used by trends and cannot be deleted. Please move the trends to another segment first.'))
->danger()
->send();
}
})