Select::createOptionUsing not updating selected element in v3
I can't make it work. I'm using v3.0.39
Here is an dummy example The record is created but the select doesn't reflect the change. Thanks in advance
Here is an dummy example The record is created but the select doesn't reflect the change. Thanks in advance
26 Replies
Q.. Why not use:
as per the docs?
Because it's not a real eloquent relationship in the model.
So make it a relationship? since tag is a table on its own?
Thanks for the suggestion but it's not possible. My implementation (which I cannot share) is more complicated than the example. I simplified it to demonstrate the issue. ( It was working in v2 btw). So we're not supposed to use createOptionUsing anymore ?
Ah ok
Sorry I fixed the example, the class wass wrong
I tried with a real relationhship and I have the same result. Select is not filled after creating an item
return $tag
?
Here is the code I used for the real relationship test (like in the doc)
Is it creating the record?
It's creating the record. The issue is just the select field not updating with the created record
Select::make('tag_category_id')
?
What is the column name?It's a morphToMany relationship so no column name
->multiple()
?oh yes that can explain why it's not working on the real relationship example
not a good example then 😄
Ok so i did another test with a single relationship
real relationship? What does it mean?
If you are using morph, you should use morphto relationships.. ?
https://filamentphp.com/docs/3.x/forms/fields/select#handling-morphto-relationships
Another simpler test
It seems to be a frontend issue, The select field does not reflect the change but the state seems to be ok after creating.
that's my question. why it's not working 😄
Yeah it works fine
maybe you can clone https://github.com/filamentphp/demo
and compare to your project..
similar
did you try to remove hidden field, as a test?
GitHub
GitHub - filamentphp/demo: Source code for the demo.filamentphp.com...
Source code for the demo.filamentphp.com website. Contribute to filamentphp/demo development by creating an account on GitHub.
cleared cache, forced asset update, no more idea
yes I made my first tests without the hidden field
I'll try the demo
well I'm out of ideas. Same version of filament and livewire on the demo and my test project and still not working on my test project. removed all vendors. reinstalled. cleared all caches. republished assets. no luck. When I add ->searchable() it's working.
weird, can you share the project on github?
hhm not really. But I did try to remove searchable on the filament demo (customer field in the order resource) (don't forget to delete some customers first) and it's not working either. So it seems to be a bug when not searchable
hum
You can open an issue on GitHub, but honestly, I don't think it's a significant problem because you can use "searchable + preload.
yeah, i'll just put seachable+ preload. Thanks for your time
oh wow, i have the exact same problem and the same solution. @fabien.karsegard do you work with multi tenancy?
With searchable and preload it works. Thanks for this 😄 ...