@if(isset($layout) && $layout)
{{-- If using a layout --}}
{!! str_replace(
['{HEADER}', '{CONTENT}', '{FOOTER}'],
[$layout->header ?? '', $body, $layout->footer ?? ''],
$layout->master_template ?? '
{CONTENT}
'
) !!}
@else
{{-- Simple layout without a layout model --}}
{!! $body !!}
@endif