Skip to content

Commit 12ce2a9

Browse files
committed
Merge branch 'main' of github.com:vormkracht10/filament-mails
2 parents 74a5ae8 + 9d87822 commit 12ce2a9

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/Resources/MailResource.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ public static function infolist(Infolist $infolist): Infolist
8484
->label(__('Subject')),
8585
TextEntry::make('from')
8686
->label(__('From'))
87-
->getStateUsing(fn(Mail $record) => self::formatMailState($record->from)),
87+
->getStateUsing(fn (Mail $record) => self::formatMailState($record->from)),
8888
TextEntry::make('to')
8989
->label(__('Recipient'))
90-
->getStateUsing(fn(Mail $record) => self::formatMailState($record->to)),
90+
->getStateUsing(fn (Mail $record) => self::formatMailState($record->to)),
9191
TextEntry::make('cc')
9292
->label(__('CC'))
9393
->default('-')
94-
->getStateUsing(fn(Mail $record) => self::formatMailState($record->cc ?? [])),
94+
->getStateUsing(fn (Mail $record) => self::formatMailState($record->cc ?? [])),
9595
TextEntry::make('bcc')
9696
->label(__('BCC'))
9797
->default('-')
98-
->getStateUsing(fn(Mail $record) => self::formatMailState($record->bcc ?? [])),
98+
->getStateUsing(fn (Mail $record) => self::formatMailState($record->bcc ?? [])),
9999
TextEntry::make('reply_to')
100100
->default('-')
101101
->label(__('Reply To'))
102-
->getStateUsing(fn(Mail $record) => self::formatMailState($record->reply_to ?? [])),
102+
->getStateUsing(fn (Mail $record) => self::formatMailState($record->reply_to ?? [])),
103103
]),
104104
]),
105105
Tab::make(__('Statistics'))
@@ -171,11 +171,11 @@ public static function infolist(Infolist $infolist): Infolist
171171
TextEntry::make('type')
172172
->label(__('Type'))
173173
->badge()
174-
->url(fn(MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', [
174+
->url(fn (MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', [
175175
'record' => $record,
176176
'tenant' => filament()->getTenant()?->id,
177177
]))
178-
->color(fn(EventType $state): string => match ($state) {
178+
->color(fn (EventType $state): string => match ($state) {
179179
EventType::DELIVERED => 'success',
180180
EventType::CLICKED => 'clicked',
181181
EventType::OPENED => 'info',
@@ -189,7 +189,7 @@ public static function infolist(Infolist $infolist): Infolist
189189
return ucfirst($state->value);
190190
}),
191191
TextEntry::make('occurred_at')
192-
->url(fn(MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', [
192+
->url(fn (MailEvent $record) => route('filament.' . filament()->getCurrentPanel()?->getId() . '.resources.mails.events.view', [
193193
'record' => $record,
194194
'tenant' => filament()->getTenant()?->id,
195195
]))
@@ -219,7 +219,7 @@ public static function infolist(Infolist $infolist): Infolist
219219
->hiddenLabel()
220220
->label(__('HTML Content'))
221221
->extraAttributes(['class' => 'overflow-x-auto'])
222-
->formatStateUsing(fn(string $state, Mail $record): View => view(
222+
->formatStateUsing(fn (string $state, Mail $record): View => view(
223223
'filament-mails::mails.preview',
224224
['html' => $state, 'mail' => $record],
225225
)),
@@ -229,7 +229,7 @@ public static function infolist(Infolist $infolist): Infolist
229229
TextEntry::make('html')
230230
->hiddenLabel()
231231
->extraAttributes(['class' => 'overflow-x-auto'])
232-
->formatStateUsing(fn(string $state, Mail $record): View => view(
232+
->formatStateUsing(fn (string $state, Mail $record): View => view(
233233
'filament-mails::mails.html',
234234
['html' => $state, 'mail' => $record],
235235
))
@@ -260,12 +260,12 @@ public static function infolist(Infolist $infolist): Infolist
260260
TextEntry::make('attachments')
261261
->hiddenLabel()
262262
->label(__('Attachments'))
263-
->visible(fn(Mail $record) => $record->attachments->count() == 0)
263+
->visible(fn (Mail $record) => $record->attachments->count() == 0)
264264
->default(__('Email has no attachments')),
265265
RepeatableEntry::make('attachments')
266266
->hiddenLabel()
267267
->label(__('Attachments'))
268-
->visible(fn(Mail $record) => $record->attachments->count() > 0)
268+
->visible(fn (Mail $record) => $record->attachments->count() > 0)
269269
->schema([
270270
Grid::make(3)
271271
->schema([
@@ -277,7 +277,7 @@ public static function infolist(Infolist $infolist): Infolist
277277
->label(__('Mime Type')),
278278
ViewEntry::make('uuid')
279279
->label(__('Download'))
280-
->getStateUsing(fn($record) => $record)
280+
->getStateUsing(fn ($record) => $record)
281281
->view('filament-mails::mails.download'),
282282
]),
283283
]),
@@ -297,7 +297,7 @@ public static function table(Table $table): Table
297297
->label(__('Status'))
298298
->sortable()
299299
->badge()
300-
->color(fn(string $state): string => match ($state) {
300+
->color(fn (string $state): string => match ($state) {
301301
__('Soft Bounced') => 'warning',
302302
__('Hard Bounced') => 'danger',
303303
__('Complained') => 'danger',
@@ -317,27 +317,27 @@ public static function table(Table $table): Table
317317
Tables\Columns\IconColumn::make('attachments')
318318
->label('')
319319
->alignLeft()
320-
->getStateUsing(fn(Mail $record) => $record->attachments->count() > 0)
321-
->icon(fn(string $state): string => $state ? 'heroicon-o-paper-clip' : ''),
320+
->getStateUsing(fn (Mail $record) => $record->attachments->count() > 0)
321+
->icon(fn (string $state): string => $state ? 'heroicon-o-paper-clip' : ''),
322322
Tables\Columns\TextColumn::make('to')
323323
->label(__('Recipient'))
324324
->limit(50)
325-
->getStateUsing(fn(Mail $record) => self::formatMailState(emails: $record->to, mailOnly: true))
325+
->getStateUsing(fn (Mail $record) => self::formatMailState(emails: $record->to, mailOnly: true))
326326
->sortable()
327327
->searchable(),
328328
Tables\Columns\TextColumn::make('opens')
329329
->label(__('Opens'))
330-
->tooltip(fn(Mail $record) => __('Last opened at :date', ['date' => $record->last_opened_at?->format('d-m-Y H:i')]))
330+
->tooltip(fn (Mail $record) => __('Last opened at :date', ['date' => $record->last_opened_at?->format('d-m-Y H:i')]))
331331
->sortable(),
332332
Tables\Columns\TextColumn::make('clicks')
333333
->label(__('Clicks'))
334-
->tooltip(fn(Mail $record) => __('Last clicked at :date', ['date' => $record->last_clicked_at?->format('d-m-Y H:i')]))
334+
->tooltip(fn (Mail $record) => __('Last clicked at :date', ['date' => $record->last_clicked_at?->format('d-m-Y H:i')]))
335335
->sortable(),
336336
Tables\Columns\TextColumn::make('sent_at')
337337
->label(__('Sent At'))
338338
->dateTime('d-m-Y H:i')
339339
->since()
340-
->tooltip(fn(Mail $record) => $record->sent_at?->format('d-m-Y H:i'))
340+
->tooltip(fn (Mail $record) => $record->sent_at?->format('d-m-Y H:i'))
341341
->sortable()
342342
->searchable(),
343343
])
@@ -455,8 +455,8 @@ public static function getPages(): array
455455
private static function formatMailState(array $emails, bool $mailOnly = false): string
456456
{
457457
return collect($emails)
458-
->mapWithKeys(fn($value, $key) => [$key => $value ?? $key])
459-
->map(fn($value, $key) => $mailOnly ? $key : ($value === null ? $key : "$value <$key>"))
458+
->mapWithKeys(fn ($value, $key) => [$key => $value ?? $key])
459+
->map(fn ($value, $key) => $mailOnly ? $key : ($value === null ? $key : "$value <$key>"))
460460
->implode(', ');
461461
}
462462

@@ -466,4 +466,4 @@ public static function getWidgets(): array
466466
MailStatsWidget::class,
467467
];
468468
}
469-
}
469+
}

0 commit comments

Comments
 (0)