New Record Modal does not work in Select Form
I have a Select button that draws options from the database. I also want the user to be able to create a new category in case it doesnt exist in one of the available options. However, when I press the add button, it changes into a loading icon for a bit then reverts back to the original + icon. The modal does not appear at all.
Here is the code used for it:
Solution:Jump to solution
Okay, it turns out you need to add
to the livewire component's blade file. Thanks for taking the time though!...
2 Replies
Don't know for sure but try to help:
- What is the relation between user and category
I have an working version and did it like this:
->createOptionForm(function () {
return [
TextInput::make('name')
->label('Name')
->required()
->unique(),
Hidden::make('user_id')->default(Auth::id()),
];
})
->createOptionUsing(function (array $data): int {
return ContactList::create($data)->id;
}),
Again, don't know for sure but hope this helps!
Solution
Okay, it turns out you need to add
to the livewire component's blade file. Thanks for taking the time though!