-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I cannot use belongsTo fields with in a Dependency container? #31
Comments
Until it gets fixed here's a quick'n'dirty workaround (without the create relation option): DependencyContainer::make([
Select::make('Related Model', 'related_id')
->searchable()
->options(
RelatedModel::all(['id', 'name'])
->mapWithKeys(fn ($m) => [$m->id => $m->name])
),
])->dependsOnIn('eventPlaceType.id', [3,4,5]), |
Any update on if this bug will actually be fixed |
If I could receive any hints on what the actual issue is, I'm more than happy to provide a PR! |
The issue here is it will not show any options in the list of BelongsTo relationships (the list will appear empty) and also search will not work @Anticom |
hi DependencyContainer::make([
BelongsTo::make('Based on (one git project)', 'basedOnProject', '\App\Nova\Projects')
->hideFromIndex()->searchable()->nullable()->dontReorderAssociatables()
->hideFromDetail(function () use ($request) {
if ($this->basedOnId > 0 && $this->redirectUrl == '') return false;
else return true;
})
])->dependsOnEmpty('redirectUrl'); redirectUrl is string field But this code not work (see 404 when try to add/edit resource) |
yeah, this still happens |
Here is my code.
the belongsTo dropdown does toggle based on the parent, but there is no data in the dropdown??
The text was updated successfully, but these errors were encountered: