You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass on model context for Components\BelongsToSelect to modify query
I'd like to populate the select with a list limited based on another field value the model has.
One example I've is where I'd like to populate the dropdown with users that are part of the same organization as the user
Components\BelongsToSelect::make('manager_id')
->relationship('manager', 'email', function ($query) {
return$query->where('organization_id', '1');
})
Right now I can only input static values as both Resource and BelongsToSelect don't yet have the record in their context. The records gets added after the form method called:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Pass on model context for Components\BelongsToSelect to modify query
I'd like to populate the select with a list limited based on another field value the model has.
One example I've is where I'd like to populate the dropdown with users that are part of the same organization as the user
Right now I can only input static values as both Resource and BelongsToSelect don't yet have the record in their context. The records gets added after the form method called:
Beta Was this translation helpful? Give feedback.
All reactions