@extends('front.layout.app') @section('seo_title') {{ $blog_data->seo_title }} @endsection @section('seo_meta_description') {{ $blog_data->seo_meta_description }} @endsection @section('main_content')
@if ($blog_data->page_type === 'left_sidebar') @include('front.layout.blog_sidebar') @endif {{-- The $variable: The match expression compares the value of $variable (in your case, $blog_data->page_type) with different possible values. !! when matched , the result will be assigned to mainclass !! --}} @php $mainClass = match($blog_data->page_type) { 'left_sidebar' => 'col-lg-8 col-md-8 col-12', 'right_sidebar' => 'col-lg-8 col-md-8 col-12', default => 'col-lg-10 offset-lg-1 col-md-10 offset-md-1 col-12' }; @endphp
@isset($blog_data->blog_photo)
#
@endisset
  • Bizwheel
  • {{ $blog_data->created_at->format('F j, Y') }}
  • {{ $total_comments }} comments

{!! $blog_data->blog_text !!}

@isset($blog_data->blog_photo2) # @endisset

{!! $blog_data->blog_photo2_text !!}

    @php $blog_list_items = explode("\n", $blog_data->blog_photo2_lists); @endphp @foreach ($blog_list_items as $item)
  • {!! $item !!}
  • @endforeach

{!! $blog_data->blog_bottom_text1 !!}

{!! $blog_data->blog_bottom_text2 !!}

{{ $blog_data->blog_bottom_text_name }}

{!! $blog_data->blog_bottom_text3 !!}

@if($previous) Previous Post @endif
@if($next) Next Post @endif
{{-- !! TO PASS THE EACH COMMENT ID AKA ITEM ID TO HIDDEN FIELD AKA REPLY ID IN MODAL USE data-target="#replyModal{{ $item->id }}" IN REPLY ICON AND id="replyModal{{ $item->id }}" IN MODAL ID --}} @foreach ($comments as $item) @php $hash = md5(strtolower(trim($item->person_name))); $avatar = "https://www.gravatar.com/avatar/$hash?s=80&d=retro"; @endphp
Profile {{ $item->person_name }} {{ $item->created_at->format('F j, Y') }}

{{ $item->person_comment }}

↩ Reply
{{-- “In the first main comment loop iteration, the main comment row is fetched, and its ID = comment_id is used to find all rows in the replies table where comment_id equals that ID, and they are shown below --}} @if (!empty($item->fromCommentwReply) && $item->fromCommentwReply->count()) @foreach ($item->fromCommentwReply as $item2)
Profile {{ $item2->person_name }} {{ $item2->created_at->format('F j, Y') }}

{{ $item2->person_comment }}

@endforeach @endif @endforeach
@if (Auth::guard('admin')->user())

Reply to the messages

* All fields are required

@csrf
@else

{{ $total_comments === 0?'Be the first one to comment':'Leave a comment' }}

* All fields are required

@csrf
@endif
@if ($blog_data->page_type === 'right_sidebar') @include('front.layout.blog_sidebar') @endif
@endsection