@php if (Cache::has('index_header') ) { @endphp {!! Cache::get('index_header') !!} @php } else { $cachedData = view('portal.layout.header')->render(); Cache::put('index_header', $cachedData); @endphp @include('portal.layout.header') @php } @endphp