Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set config for loaded select input #5846

Open
amismailz opened this issue Jan 31, 2024 · 0 comments
Open

Cannot set config for loaded select input #5846

amismailz opened this issue Jan 31, 2024 · 0 comments

Comments

@amismailz
Copy link

  • Laravel Version: 8.83.26
  • PHP Version: 7.4
  • Laravel-admin: 1.8.19

Description:

I'm trying to set custom configurations to a multipleSelect input. This select is loaded from another select. I see that the current implementation of loaded select is not configurable.

Steps To Reproduce:

$form->select('job_id', __('Job'))->options(Jobs::all()->pluck('title', 'id'))->load('experiences', url('admin/experiences/json-list'));
        $form->multipleSelect('experiences', __('Experiences'))->config('closeOnSelect', false)->options(function ($ids) {
            if ($ids) {
                $experience = Experience::find($ids[0]);
                return $experience->job->experiences()->pluck('title', 'id');
            } elseif (request()->job_id) {
                return Jobs::find(request()->job_id)->experiences()->pluck('title', 'id');
            }
        })->rules('required');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant