Как создать зависимый выбор с помощью рюкзака для сна? - PullRequest
0 голосов
/ 28 августа 2018

Как создать зависимый выбор , например, отношение страны / города, используя рюкзак для laravel ? Как: просто показать города для выбранной страны

    $this->crud->addField([  // Select2
        'label' => "country",
        'type' => 'select2',
        'name' => 'country_id', // the db column for the foreign key
        'entity' => 'country', // the method that defines the relationship in your Model
        'attribute' => 'country', // foreign key attribute that is shown to user
        'model' => "App\Models\Country" // foreign key model
     ]);

    $this->crud->addField([  // Select2
        'label' => "City",
        'type' => 'select2',
        'name' => 'city_id', // the db column for the foreign key
        'entity' => 'city', // the method that defines the relationship in your Model
        'attribute' => 'city', // foreign key attribute that is shown to user
        'model' => "App\Models\City" // foreign key model
     ]);

1 Ответ

0 голосов
/ 26 сентября 2018

Для этого есть функция, но она еще не объединена. Вы можете взглянуть на [Функция] [3.4] [Готово]. Select2_from_ajax может зависеть от любого другого ввода , проверить измененные файлы и воспроизвести их в вашей установке.

...