{{-- ================= HERO IMAGE ================= --}} @if (optional($work->detail)->inner_hero_media)
{{ $work->title }}
@endif {{-- ================= BODY (Title Left + Description Right) ================= --}}
{{-- GRID --}}
{{-- LEFT : TITLE --}}

@php $heading = $work->detail->intro_heading ?? $work->title; $words = explode(' ', trim($heading)); if(count($words) > 2){ $lastTwo = array_splice($words, -2); $firstPart = implode(' ', $words); $secondLine = implode(' ', $lastTwo); } else { $firstPart = ''; $secondLine = implode(' ', $words); } @endphp {!! $firstPart !!} {{ $secondLine }}

{{-- RIGHT : DESCRIPTION --}}
{{-- DESCRIPTION --}} @if (optional($work->detail)->intro_description)

{{ $work->detail->intro_description }}

@endif {{-- SERVICES --}} @php $services = $work->detail->services ?? null; if (is_string($services)) { $services = json_decode($services, true); } @endphp @if (!empty($services) && is_array($services))
SERVICES
    @foreach ($services as $service)
  • {{ $service }}
  • @endforeach
@endif
{{-- ================= VIDEO (ONLY IF EXISTS) ================= --}} @if (optional($work->detail)->inner_video)
{{-- YOUTUBE --}} @if (Str::contains($work->detail->inner_video, ['youtube.com', 'youtu.be'])) @php preg_match( '%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $work->detail->inner_video, $m ); $videoId = $m[1] ?? null; @endphp @if($videoId) @endif {{-- UPLOADED VIDEO --}} @elseif (Str::startsWith($work->detail->inner_video, 'works/')) {{-- DIRECT VIDEO URL --}} @else @endif
@endif