@php if (!function_exists('calculateReadingTime')) { function calculateReadingTime($body) { if (!$body) { return 2; } $text = strip_tags($body); $words = str_word_count($text); $minutes = ceil($words / 200); return max(1, $minutes); } } @endphp @foreach ($articles as $article) @php $articleImage = $article->topImage ?? $article->featuredImage; $articleUrl = "/{$article->slug}"; $shareUrl = urlencode(url($articleUrl)); $shareTitle = urlencode($article->title); $shareImage = urlencode($articleImage?->file_url ?? ''); $publishedDate = $article->published_at ?? $article->created_at; @endphp
{{ Str::limit($article->headline ?? ($article->excerpt ?? ''), 150) }}
@endif