© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
emil

Soft-deleted relations

Found other posts before but no answers.

Works when campaign is soft-deleted:
TextColumn::make('campaign.user.name')

However, this doesn't work:
->url(fn ($record) => UserResource::getUrl('edit', [$record->campaign->user]))

modifyQueryUsing is eager loading it - however that doesn't seem to affect $record.

Query being run:
select * from
campaigns
campaigns
where
campaigns
campaigns
.
id
id
in (5) and
campaigns
campaigns
.
deleted_at
deleted_at
is null

Modify query on the table:

->modifyQueryUsing(function ($query) {
return $query->with(['campaign' => function ($query) {
$query->withTrashed()->with(['user']);
}]);
})
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Soft-deleted relations
FilamentFFilament / ❓┊help
2y ago
Select list: How to handle soft deleted (trashed) relations?
FilamentFFilament / ❓┊help
3y ago