Update 07-managing-relationships.md

This commit is contained in:
Dan Harrin
2026-07-28 13:54:07 -04:00
parent 519f073736
commit e847a1bfb7
@@ -1023,6 +1023,22 @@ public function table(Table $table): Table
}
```
<Aside variant="danger">
`modifyQueryUsing()` scopes the query for records that already belong to the relationship — the table listing, and actions that operate on its rows, such as `DetachAction`, `DissociateAction`, and bulk actions. It is **not** applied to the records available to `AttachAction` or `AssociateAction`, since those records are outside the relationship by definition.
To restrict which records may be attached or associated, scope the options using the `recordSelectOptionsQuery()` method on the action. Filament resolves the submitted record against that query, so records outside it are rejected, even if a user tampers with the submitted modal state:
```php
use Filament\Actions\AttachAction;
use Illuminate\Database\Eloquent\Builder;
AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query) => $query->where('is_active', true))
```
Learn more about scoping the options to [attach](#scoping-the-options-to-attach) or [associate](#scoping-the-options-to-associate).
</Aside>
## Customizing the relation manager title
To set the title of the relation manager, you can use the `$title` property on the relation manager class: