Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
30 | function getDropdownDataSet($data) |
||
31 | { |
||
32 | if (!$data ) { |
||
33 | return collect()->toJson(); |
||
34 | } |
||
35 | $data=collect($data); |
||
36 | if (is_scalar($data->first())) { |
||
37 | $data=collect($data)->map(fn($value,$key)=>['key'=>$key, 'value'=>$value]); |
||
38 | } |
||
39 | $data = json_encode($data->values()->toArray()); |
||
40 | return $data; |
||
41 | } |
||
42 |