Skip to content

Commit

Permalink
fix deleted at
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Nov 18, 2024
1 parent 9b13a1d commit 95132bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Filament/Resources/PointResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ public static function table(Table $table): Table

DeleteBulkAction::make()
->requiresConfirmation()
->action(function (Collection $records) {
$records->each(function ($record) {
$record->contribution()->delete();
$record->delete();
});
})
->label(__('map_points.buttons.delete')),

]),
Expand Down
3 changes: 2 additions & 1 deletion app/Filament/Resources/PointResource/Pages/ViewMapPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ protected function getHeaderActions(): array
Action::make('delete')
->requiresConfirmation()
->action(function () {
$this->getRecord()->delete();
$this->record->contribution()->delete();
$this->record->delete();

return redirect($this->getResource()::getUrl('index'));
})
Expand Down

0 comments on commit 95132bf

Please sign in to comment.