Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 876a2e1

Browse files
committed
Defer to Js::from for setting on/off values
1 parent 4d05af8 commit 876a2e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

resources/views/components/choice/switch-toggle.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div x-data="{
2-
onValue: {{ json_encode($onValue) }},
3-
offValue: {{ json_encode($offValue) }},
2+
onValue: {{ \Illuminate\Support\Js::from($onValue) }},
3+
offValue: {{ \Illuminate\Support\Js::from($offValue) }},
44
@if ($hasWireModel())
55
value: @entangle($attributes->wire('model')),
66
@elseif ($hasXModel())
77
value: {{ $attributes->first('x-model') }},
88
@else
9-
value: {{ json_encode($value) }},
9+
value: {{ \Illuminate\Support\Js::from($value) }},
1010
@endif
1111
get isPressed() {
1212
return this.value === this.onValue;

0 commit comments

Comments
 (0)