@use('app\Helpers\Helpers') @extends('frontend.layout.master') @section('title', @$blog?->meta_title ?? @$blog?->title) @section('meta_description', @$blog?->meta_description ?? @$blog?->description) @section('keywords', @$blog?->tags && $blog->tags->isNotEmpty() ? $blog->tags->pluck('name')->implode(', ') : '') @section('canonical_url', route('frontend.blog.details', $blog?->slug)) {{-- Open Graph Tags for Facebook --}} @section('og_title', @$blog?->meta_title ?? @$blog?->title) @section('og_description', @$blog?->meta_description ?? @$blog?->description) @section('og_image', @$blog?->media?->first()?->getUrl()) @section('og_url', route('frontend.blog.details', $blog?->slug)) @section('og_type', 'article') {{-- Article-specific Open Graph Tags --}} @push('og_article') @if($blog) @if($blog->created_by) @endif @if($blog->categories->isNotEmpty()) @foreach($blog->categories as $category) @endforeach @endif @if($blog->tags->isNotEmpty()) @foreach($blog->tags as $tag) @endforeach @endif @endif @endpush {{-- Twitter Card Tags --}} @section('twitter_title', @$blog?->meta_title ?? @$blog?->title) @section('twitter_description', @$blog?->meta_description ?? @$blog?->description) @section('twitter_image', @$blog?->media?->first()?->getUrl()) @push('twitter_card') @if($blog && $blog->created_by) @endif @endpush {{-- Additional Meta Tags --}} @push('additional_meta') @if($blog) @if($blog->categories && $blog->categories->isNotEmpty() && $blog->categories->first()) @endif @endif @endpush {{-- Schema.org JSON-LD Structured Data for Article --}} @push('structured_data') @if($blog) @php $themeOptions = Helpers::getThemeOptions(); $schemaData = [ "@context" => "https://schema.org", "@type" => "BlogPosting", "headline" => addslashes($blog->meta_title ?? $blog->title), "description" => addslashes(strip_tags($blog->meta_description ?? $blog->description)), "image" => $blog->media?->first()?->getUrl() ?? asset('admin/images/No-image-found.jpg'), "datePublished" => $blog->created_at->toIso8601String(), "dateModified" => $blog->updated_at->toIso8601String(), "author" => [ "@type" => "Person", "name" => $blog->created_by->name ?? 'Admin' ], "publisher" => [ "@type" => "Organization", "name" => $themeOptions['general']['site_title'] ?? config('app.name'), "logo" => [ "@type" => "ImageObject", "url" => asset($themeOptions['general']['header_logo'] ?? 'admin/images/logo.png') ] ], "mainEntityOfPage" => [ "@type" => "WebPage", "@id" => route('frontend.blog.details', $blog->slug) ], "wordCount" => str_word_count(strip_tags($blog->content ?? '')), "inLanguage" => app()->getLocale() ]; if($blog->categories && $blog->categories->isNotEmpty() && $blog->categories->first()) { $schemaData["articleSection"] = $blog->categories->first()->title; } if($blog->tags && $blog->tags->isNotEmpty()) { $schemaData["keywords"] = $blog->tags->pluck('name')->implode(', '); } @endphp @endif @endpush @section('breadcrumb') @endsection @section('content') @if ($blog)
{{ $blog?->title }}

{{ $blog?->title }}

@if($blog?->tags && $blog->tags->isNotEmpty() && $blog->tags->first()) {{ $blog->tags->first()->name }} @endif
    @if($blog?->categories && $blog->categories->isNotEmpty() && $blog->categories->first())
  • {{ $blog->categories->first()->title }}
  • @endif
  • {{ Helpers::dateTimeFormat($blog?->created_at, 'd M, Y') }}
- {{__('frontend::static.blogs.by')}} {{ $blog?->created_by?->name ?? 'unknown' }}

{{__('frontend::static.blogs.description')}}

{{ $blog?->description }}

    {!! $blog?->content !!}
@if(count($blog?->comments ?? []))

{{__('frontend::static.blogs.comments')}} ({{ $blog->comments->where('parent_id', null)->count() }})

@endif

{{__('frontend::static.blogs.leave_a_comment')}}

@csrf
@error('message') {{ $message }} @enderror
@auth
@endauth @guest @endguest
@endif

{{__('frontend::static.blogs.recent_blogs')}}

{{__('frontend::static.home_page.view_all')}}
@forelse ($recentBlogs as $recentBlog)

{{ $recentBlog?->title }}

    @if($recentBlog?->categories && $recentBlog->categories->isNotEmpty() && $recentBlog->categories->first())
  • {{ $recentBlog->categories->first()->title }}
  • @endif
  • {{ Helpers::dateTimeFormat($recentBlog?->created_at, 'd M, Y') }}
@empty

{{__('frontend::static.blogs.not_found')}}

@endforelse
@endsection @push('js') @endpush