Forms/Docs: Add documentation for new ignoreRecord argument

This commit is contained in:
Ryan Chandler
2024-01-24 16:43:41 +00:00
parent ec108ca1d1
commit b3d061bb98
@@ -204,6 +204,19 @@ Select::make('author_id')
->preload()
```
### Excluding the current record
When working with recursive relationships, you will likely want to remove the current record from the set of results.
This can be easily be done using the `ignoreRecord` argument.
```php
use Filament\Forms\Components\Select;
Select::make('parent_id')
->relationship('parent', 'name', ignoreRecord: true)
```
### Customizing the relationship query
You may customize the database query that retrieves options using the third parameter of the `relationship()` method: