label('Approve & anonymise') ->icon('heroicon-o-check-circle') ->color('success') ->visible(fn () => $this->record->status !== AccountDeletionRequest::STATUS_COMPLETED) ->form([ Textarea::make('notes')->label('Internal notes')->rows(3), ]) ->requiresConfirmation() ->action(function (array $data, AccountDeletionService $service) { $service->approve($this->record, Auth::user(), $data['notes'] ?? null); $this->record->refresh(); Notification::make() ->title('Account anonymised successfully') ->success() ->send(); }) ->authorize(fn () => Auth::user()?->can('update', $this->record) ?? false), Action::make('deny') ->label('Deny request') ->icon('heroicon-o-x-circle') ->color('danger') ->visible(fn () => $this->record->status === AccountDeletionRequest::STATUS_PENDING) ->form([ Textarea::make('notes')->label('Internal notes')->rows(3)->required(), ]) ->requiresConfirmation() ->action(function (array $data, AccountDeletionService $service) { $service->deny($this->record, Auth::user(), $data['notes'] ?? null); $this->record->refresh(); Notification::make() ->title('Deletion request marked as denied') ->success() ->send(); }) ->authorize(fn () => Auth::user()?->can('update', $this->record) ?? false), ]; } }