Multi select selected issue
In twill3 I created 2 CRUD, ImportedItem and ItemTypes. I used Multiselect for selecting ItemTypes.
$form->add(
MultiSelect::make()
->name('item_types_id')
->label('Item Type')
->inline()
->options(
Options::make(
ItemType::all()
->map(
fn($sector) => Option::make(
$sector->id,
$sector->title
)
)
->toArray()
)
)
);
This is the code. I also tried another code also
$form->add(
MultiSelect::make()
->inline()
->name('item_types_id')
->label('Item Type')
->searchable()
->options(
app()->make(ItemTypeRepository::class)->listAll()->toArray()
)
);
Here updated on pivot table. But after refresh its not selected.
How do I selected this in multiselect?
ifox•94d ago
Hi @Somnath a multi select between 2 models needs a pivot table and associated eloquent relationships, did you set that up?
1.4KMembers
View on DiscordWant results from more Discord servers?
More PostsUpgrading from 2.0 to 3.0 - routing issuesHello! I'm currently updating twill to 3.0 from 2.0, and I'm having some issues with routes.
I'm getDisabled defaults in controller based on user RoleGroupI want to disable, create, edit or delete actions according to user RoleGroup or there is another waDrag and drop issueHello, any idea how to achive DnD working on modules list.
Problem is in that when you go below limiFile library 404 errorHello, I'm encountering issues with the file library. When I upload a file, such as a .txt file, it'