Skip to content

Commit

Permalink
Merge pull request #4 from ziming/patch-1
Browse files Browse the repository at this point in the history
Bugfix: Allow json editor to render json column that is casted to array or object
  • Loading branch information
invaders-xx authored Jun 16, 2022
2 parents 8296ae2 + 05b5c95 commit 92b5fa4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/views/json-editor.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@php
$statePath = $getStatePath();
if (if (is_array($statePath) || is_object($statePath) ) {
$statePath = json_encode($statePath);
}
@endphp
<x-forms::field-wrapper
:id="$getId()"
:label="$getLabel()"
Expand All @@ -8,7 +14,7 @@
:required="$isRequired()"
:state-path="$getStatePath()"
>
<div x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }"
<div x-data="{ state: $wire.entangle('{{ $statePath }}') }"
x-init="$nextTick(() => {
const options = {
modes: {{ $getModes() }},
Expand Down

0 comments on commit 92b5fa4

Please sign in to comment.