Skip to content

Commit

Permalink
fix when "files" isn't an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 committed Jan 23, 2025
1 parent aa113fd commit 3938838
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public function table(Table $table): Table

return trans_choice('activity.'.str($state)->replace(':', '.'), array_get($properties, 'count', 1), $properties);
})
->tooltip(fn (ActivityLog $activityLog) => implode(',', array_get($activityLog->properties, 'files', []))),
->tooltip(function (ActivityLog $activityLog) {
$files = array_get($activityLog->properties, 'files', []);

return is_array($files) ? implode(',', $files) : null;
}),
TextColumn::make('user')
->state(fn (ActivityLog $activityLog) => $activityLog->actor instanceof User ? $activityLog->actor->username : 'System')
->tooltip(fn (ActivityLog $activityLog) => auth()->user()->can('seeIps activityLog') ? $activityLog->ip : '')
Expand Down

0 comments on commit 3938838

Please sign in to comment.