@extends('frontend.layout') @php // Admin can save EITHER a structured array (title / subtitle / // reasons[]) OR a raw HTML string. Detect which one and render // the right path below. $rawHtml = is_string($content) && trim($content) !== '' ? $content : null; $c = is_array($content) ? $content : []; $pageTitle = $c['title'] ?? __('Why Us'); @endphp @section('title', $pageTitle . ' — ' . config('app.name')) @section('content')
@if($rawHtml)
{!! $rawHtml !!}
@else

Why Choose Us

@if(!empty($c['subtitle']))

{{ $c['subtitle'] }}

@endif
@if(!empty($c['reasons']) && is_array($c['reasons']))
@foreach($c['reasons'] as $i => $reason) @if(!empty($reason['title']))
{{ $i + 1 }}

{{ $reason['title'] }}

{{ $reason['desc'] ?? '' }}

@endif @endforeach
@endif @endif
@endsection