P
P
Pradd_by2019-05-11 12:13:12
Laravel
Pradd_by, 2019-05-11 12:13:12

Help with laravel-admin. content of multipleSelect not showing?

When editing an application ($form), the old data is not displayed in the multipleSelect field.
The code:

$form->multipleSelect('addWorks', 'Виды доп работы')
    ->options($addWork::all()->pluck('name', 'id'))
    ->help('Выбирать, только если есть доп работы.');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pradd_by, 2019-05-16
@Pradd_by

I figured it out myself, or rather I spied on the git of the Chinese.
I didn't specify in the question that it was a Many-to-Many relationship, and just had to rename the "relationship" from addWorks to add_works (snake_case ).
https://github.com/z-song/laravel-admin/issues/657

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question