Skip to content

Commit b55f6fd

Browse files
wip
1 parent 7f7df34 commit b55f6fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Resources/UserResource/Pages/ViewUser.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ public function table(Table $table): Table
157157

158158
return true;
159159
}),
160+
161+
Action::make('clear_activity')
162+
->label(__('Clear Activity'))
163+
->icon(fn(): BackedEnum => Heroicon::Trash)
164+
->action(function (Model $record): void {
165+
$record->traffic()->delete();
166+
})
167+
->requiresConfirmation()
168+
->modalDescription(__('This action will delete all traffic records for this user. This action cannot be undone.'))
169+
->visible(fn(User $record): bool => $record->traffic()->exists() && $record->traffic()->whereNot('path', 'livewire/update')->exists()),
160170
])
161171
->recordAction('view')
162172
->recordActions([

0 commit comments

Comments
 (0)