F
Filament8mo ago
Subham

How do i Get the current record in Select i want values except the current record id

Select::make('parent_id') ->label('Header') ->relationship('parent', 'name') ->default(null)
Solution:
```php Select::make('parent_id') ->label('Header') ->relationship( name:'parent',...
Jump to solution
3 Replies
Solution
toeknee
toeknee8mo ago
Select::make('parent_id')
->label('Header')
->relationship(
name:'parent',
titleAttribute:'name',
modifyQueryUsing: fn (Builder $query, $record) => $query->where('id', '<>', $record->id),
)
->default(null)
Select::make('parent_id')
->label('Header')
->relationship(
name:'parent',
titleAttribute:'name',
modifyQueryUsing: fn (Builder $query, $record) => $query->where('id', '<>', $record->id),
)
->default(null)
Subham
SubhamOP8mo ago
Thank you
Want results from more Discord servers?
Add your server