© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Garrita

Select Relationship Modify Query Using

Hi everyone,

When I create an auction I select a car but the dropdown only shows the cars that don't belongs to another auction (I use modifyQueryUsing), so this works when I create.

The issue is when I try to update an auction, I cannot see my car selected in the dropdown list because that car already belongs to the same auction that I'm updating so how can I fix that?

Select::make('car_id')
  ->label('Car')
  ->relationship(
      name: 'car',
      titleAttribute: 'name',
      modifyQueryUsing: fn (Builder $query) =>             $query->whereDoesntHave('auction')
      )
  ->required(),
Select::make('car_id')
  ->label('Car')
  ->relationship(
      name: 'car',
      titleAttribute: 'name',
      modifyQueryUsing: fn (Builder $query) =>             $query->whereDoesntHave('auction')
      )
  ->required(),
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

Modify Query Using nested relationship
FilamentFFilament / ❓┊help
2y ago
Pivot Select using Relationship
FilamentFFilament / ❓┊help
2w ago
Modify Query Using with Live
FilamentFFilament / ❓┊help
11mo ago
soft delete modify query using
FilamentFFilament / ❓┊help
16mo ago