Skip to content

Commit

Permalink
Order events
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Sep 27, 2024
1 parent d1b0d58 commit 046d955
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Resources/MailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ public static function infolist(Infolist $infolist): Infolist
Tab::make(__('Events'))
->schema([
RepeatableEntry::make('events')
->state(function (Mail $record) {
return $record->events->sortByDesc('occurred_at');
})
->hiddenLabel()
->schema([
TextEntry::make('type')
Expand Down Expand Up @@ -257,12 +260,12 @@ public static function infolist(Infolist $infolist): Infolist
TextEntry::make('attachments')
->hiddenLabel()
->label(__('Attachments'))
->visible(fn (Mail $record) => $record->attachments->count() == 0)
->visible(fn(Mail $record) => $record->attachments->count() == 0)
->default(__('Email has no attachments')),
RepeatableEntry::make('attachments')
->hiddenLabel()
->label(__('Attachments'))
->visible(fn (Mail $record) => $record->attachments->count() > 0)
->visible(fn(Mail $record) => $record->attachments->count() > 0)
->schema([
Grid::make(3)
->schema([
Expand Down Expand Up @@ -438,4 +441,4 @@ public static function getWidgets(): array
MailStatsWidget::class,
];
}
}
}

0 comments on commit 046d955

Please sign in to comment.