@extends('layouts.site') @section('content') @php // Admin verisi varsa ve boş değilse dinamik render, yoksa statik HTML $pageData = $page->data ?? []; $hasDynamic = is_array($pageData) && count($pageData) > 0; @endphp @if($hasDynamic) {{-- Dinamik (admin) veri ile render --}}

{{ data_get($page->data ?? [], 'hero_title') }}

{{ data_get($page->data ?? [], 'hero_subtitle') }}

@if($img = data_get($page->data ?? [], 'hero_image')) hero @endif
@if($btn = data_get($page->data ?? [], 'hero_primary_url')) {{ data_get($page->data ?? [], 'hero_primary_text') }} @endif @if($btn2 = data_get($page->data ?? [], 'hero_secondary_url')) {{ data_get($page->data ?? [], 'hero_secondary_text') }} @endif
@if($features = data_get($page->data ?? [], 'features', []))
@foreach($features as $item)
@if(!empty($item['icon'])) @endif

{{ $item['title'] ?? '' }}

{{ $item['text'] ?? '' }}

@endforeach
@endif @if(data_get($page->data ?? [], 'cta_title'))

{{ data_get($page->data ?? [], 'cta_title') }}

{{ data_get($page->data ?? [], 'cta_button_text') }}
@endif @else {{-- Statik fallback: public/html/index.html içeriğinin bölümü --}} @php $indexPath = public_path('html/index.html'); $bodyHtml = ''; if (file_exists($indexPath) && is_readable($indexPath)) { $html = file_get_contents($indexPath); // Body içeriğini çıkar if (preg_match('/]*>(.*?)<\/body>/is', $html, $m)) { $bodyHtml = $m[1]; } } // Eğer body boşsa placeholder göster if (empty(trim($bodyHtml))) { $bodyHtml = '

Admin panelinden anasayfa içeriği ekleyin veya index.html kontrol edin.

'; } @endphp {!! $bodyHtml !!} @endif @endsection