@extends('layouts.app') @php $thumb = $post->thumbnailUrl(); $categoryName = $post->category?->blog_category_name; $author = $post->byline(); $authorName = $author?->name ?: config('app.name'); $updated = $post->updatedAtShown(); [$bodyHtml, $toc] = \App\Services\Blog\Toc::build(\App\Support\SafeHtml::clean($post->blog_details)); $ld = [ '@context' => 'https://schema.org', // raw PHP block: Blade does not compile directives here '@graph' => [ array_filter([ '@type' => 'Article', 'headline' => \Illuminate\Support\Str::limit($post->blog_title, 110, ''), 'description' => $post->seoDescription(), 'image' => $thumb ? [$thumb] : [\App\Support\Brand::socialImageUrl()], 'datePublished' => $post->created_at->toIso8601String(), 'dateModified' => ($updated ?? $post->created_at)->toIso8601String(), 'author' => $author ? $author->schema() : ['@type' => 'Organization', 'name' => $authorName], 'publisher' => ['@id' => url('/').'#org'], 'mainEntityOfPage' => $post->url(), 'articleSection' => $categoryName, 'keywords' => $post->meta_keywords ?: $post->tags->pluck('name')->implode(', '), 'wordCount' => str_word_count(strip_tags((string) $post->blog_details)), 'inLanguage' => 'en', ]), ['@type' => 'BreadcrumbList', 'itemListElement' => [ ['@type' => 'ListItem', 'position' => 1, 'name' => 'Home', 'item' => url('/')], ['@type' => 'ListItem', 'position' => 2, 'name' => 'Blog', 'item' => url('/blog')], ['@type' => 'ListItem', 'position' => 3, 'name' => $post->blog_title, 'item' => $post->url()], ]], ], ]; @endphp @section('title', $post->seoTitle()) @section('description', $post->seoDescription()) @section('canonical', $post->url()) @section('og_type', 'article') @if ($thumb) @section('og_image', $thumb) @endif @push('head') @if ($author)@endif @if ($categoryName)@endif @endpush @section('content')
Comments ({{ $post->comments->count() }})
@if (session('comment_status')){{ $c->comment }}
@foreach ($c->approvedReplies as $r){{ $r->comment }}
Leave a comment
@include('partials.errors')