Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function set($model, $key, $value, $attributes) |
||
37 | { |
||
38 | if($value instanceof Collection){ |
||
39 | $value = $value->toJson(); |
||
40 | }else { |
||
41 | $value = json_encode($value); |
||
42 | |||
43 | if ($value === false) { |
||
44 | throw JsonEncodingException::forAttribute( |
||
45 | $this, $key, json_last_error_msg() |
||
46 | ); |
||
47 | } |
||
48 | } |
||
49 | dd($value); |
||
50 | return parent::set($model, $key, $value, $attributes); |
||
51 | } |
||
52 | } |
||
53 |