Skip to content

Commit

Permalink
make options consistent with other relationship fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Jul 14, 2024
1 parent facb579 commit f0bbb14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/resources/views/crud/fields/checklist.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f0bbb14

Please sign in to comment.