@php if(old('template_id')){ $template = \Modules\Template\Entities\Template::find(old('template_id')); } isset($template->json) ? $layout = json_decode($template->json) : $layout = null; @endphp @if($layout) @foreach($layout as $item) @include("template::partials.editor.".strtolower($item->type), ["item" => $item]) @endforeach @endif