@props([ 'theme' => '', 'inline' => null, 'multiSelect' => null, 'column' => null, 'tableName' => null, 'selected' => [], ]) @php $data = collect($multiSelect['data_source']) ->transform(function (array|\Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model $entry) use ($multiSelect) { if (is_array($entry)) { $entry = collect($entry); } return [ 'value' => $entry->only([ $multiSelect['value'], $multiSelect['text'] ]) ]; }); $selected = $selected[$multiSelect['dataField']]['values'] ?? [] @endphp