Skip to content

Commit 86a1bab

Browse files
committed
eager load attachments for mails
1 parent c9f4d7c commit 86a1bab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Resources/MailResource.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Filament\Tables;
1818
use Filament\Tables\Actions\Action;
1919
use Filament\Tables\Table;
20+
use Illuminate\Database\Eloquent\Builder;
2021
use Illuminate\Support\Carbon;
2122
use Illuminate\Support\Collection;
2223
use Illuminate\Support\HtmlString;
@@ -367,6 +368,9 @@ public static function table(Table $table): Table
367368
->sortable()
368369
->searchable(),
369370
])
371+
->modifyQueryUsing(
372+
fn (Builder $query) => $query->with('attachments')
373+
)
370374
->filters([
371375
//
372376
])

0 commit comments

Comments
 (0)