From f0bbb14457f623bdf3159adde498fe8809f0218d Mon Sep 17 00:00:00 2001 From: pxpm Date: Sun, 14 Jul 2024 12:30:07 +0100 Subject: [PATCH] make options consistent with other relationship fields --- src/resources/views/crud/fields/checklist.blade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/resources/views/crud/fields/checklist.blade.php b/src/resources/views/crud/fields/checklist.blade.php index 9d8247516b..78e0aa7fbd 100644 --- a/src/resources/views/crud/fields/checklist.blade.php +++ b/src/resources/views/crud/fields/checklist.blade.php @@ -9,6 +9,10 @@ $field['options'] = $field['model']::all()->pluck($field['attribute'], $key_attribute)->toArray(); } else { $field['options'] = call_user_func($field['options'], $field['model']::query()); + + if(is_a($field['options'], \Illuminate\Contracts\Database\Query\Builder::class, true)) { + $field['options'] = $field['options']->pluck($field['attribute'], $key_attribute)->toArray(); + } } // calculate the value of the hidden input