@extends('theme::layout') @section('title', $sermon->title) @section('meta_description', Str::limit(strip_tags($sermon->description), 160)) @section('content') {{-- ─── SECTION 1: Hero ──────────────────────────────────────────────────── --}}

{{ $sermon->title }}

@if($sermon->description)

{{ Str::limit(strip_tags($sermon->description), 200) }}

@endif
@if($sermon->sermonlinks->count()) @php $dates = $sermon->sermonlinks->pluck('date')->filter()->sort(); $first = $dates->first() ? \Carbon\Carbon::parse($dates->first())->format('M Y') : null; $last = $dates->last() ? \Carbon\Carbon::parse($dates->last())->format('M Y') : null; @endphp @if($first)
{{ $first }}{{ $last && $last !== $first ? ' – ' . $last : '' }}
@endif
{{ $sermon->sermonlinks->count() }} {{ Str::plural('Chapter', $sermon->sermonlinks->count()) }}
@endif
{{ $sermon->sermonlikevote }} Likes
{{-- ─── SECTION 2: Two-column layout ────────────────────────────────────── --}}
{{-- LEFT: Sidebar --}}
{{-- Cover Image --}} @if($sermon->cover_image) {{ $sermon->title }} @else
@endif
{{-- Author --}}
@php $avatar = $sermon->user?->userprofile?->avatar_path; @endphp @if($avatar) {{ $sermon->user->name }} @else
{{ strtoupper(substr($sermon->user?->name ?? 'U', 0, 1)) }}
@endif

{{ $sermon->user?->name ?? 'Unknown' }}

{{ $sermon->user?->userprofile?->profession ?? 'Pastor' }}

{{-- Like / Share --}}
{{ $sermon->sermonlikevote }}
Share
{{-- Share Buttons --}}

Share

@php $shareUrl = urlencode(request()->url()); $shareTitle = urlencode($sermon->title); @endphp
{{-- Quick Stats --}}
Chapters: {{ $sermon->sermonlinks->count() }}
Likes: {{ $sermon->sermonlikevote }}
Added: {{ $sermon->created_at->format('d M Y') }}
{{-- RIGHT: Expandable Chapters --}}
@if($sermon->description)
{!! $sermon->description !!}
@endif @if($sermon->sermonlinks->count())
@foreach($sermon->sermonlinks as $i => $link)
{{-- Chapter Header --}} {{-- Chapter Content --}}
{{-- Video --}} @if($link->video_link)
@php $videoUrl = $link->video_link; $embedUrl = null; if (preg_match('/(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})/', $videoUrl, $m)) { $embedUrl = 'https://www.youtube.com/embed/' . $m[1]; } elseif (preg_match('/vimeo\.com\/(\d+)/', $videoUrl, $m)) { $embedUrl = 'https://player.vimeo.com/video/' . $m[1]; } @endphp @if($embedUrl)
@else
Watch Video
Open →
@endif
@endif {{-- Audio --}} @if($link->audio_link)

Audio Version

{{ $link->audio_link }}

Listen
@endif {{-- PDF --}} @if($link->pdf_link)

Sermon Notes & Outline

PDF / Document

Download
@endif
@endforeach
@else

No chapters have been added to this sermon yet.

@endif
{{-- ─── SECTION 3: Recommended Sermons ────────────────────────────────────── --}} @if($recommended->count())

More from this Church

View All →
@endif @endsection