How to Volt Component with createOptionForm and a model #18758
Replies: 3 comments 2 replies
-
|
This error happens because the form is treated as if it already has a record, while this is actually a create form. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @iqbal-fadhil , Thanks for your reply! If I remove the model binding, then I get the error ->options(function () {
$activeCompany = auth()->user()->getActiveCompany();
if (!$activeCompany) {
return [];
}
return Customer::where('company_id', $activeCompany->id)
->pluck('name', 'id');
}) |
Beta Was this translation helpful? Give feedback.
-
|
Hi @iqbal-fadhil , thanks for your reply. I was able to make it work in a standard Filament Resource so it must be something with the Volt Component or the DevDojo Wave's setup. I'll look more into it, haven't found a solution yet... Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Form builder
Package Version
V4.3.1
How can we help you?
Hi everyone,
I have a Volt Component with a form (to create a new record) and I'm trying to get createOptionForm to work on my select but I can't figure out how.
I've tried many things but either the modal doesn't open, either the modal opens and I get the error Call to a member function hasAttribute() on null which I'm guessing is because the record doesn't exists yet.
If I understand well I should assign the model to the select but I can't seem to understand how?
Am I in the right direction or doing it completely wrong?
Here is my code:
Thanks a lot!
Kevin
Beta Was this translation helpful? Give feedback.
All reactions