@extends('layouts.theme') @if(isset($blogdetail)) @section('title',"$blogdetail->title") @endif @section('main-wrapper')
@php $uname=App\User::where('id',$blogdetail->user_id)->get(); foreach($uname as $name) { $blogUser = $name; $user_name = $name->name; } @endphp
@if($blogdetail->poster != NULL) image @else image @endif
  • {{$user_name}}
  • {{date ('F d,Y',strtotime($blogdetail->created_at))}}

{{$blogdetail->title}}

{!! $blogdetail->detail !!}


@if(Auth::check() && Auth::user() != NULL)
@php $like=App\Like::orderBy('created_at','desc')->where('added','1')->where('blog_id',$blogdetail->id)->count(); $unlike=App\Like::orderBy('created_at','desc')->where('added','-1')->where('blog_id',$blogdetail->id)->count(); @endphp {{$unlike}}
@endif

{{$blogdetail->users->name}}

{{$blogdetail->users->email}}

@if(isset($exceptblog) && $exceptblog != NULL && count($exceptblog) > 0)

{{__('Recent Posts')}}

@foreach($exceptblog as $eblog)
{{$eblog->title}}
@endforeach
@endif

@if(Auth::check() && Auth::user() != NULL)

{{$blogdetail->comments->count()}} {{__('Comment')}}


@foreach ($blogdetail->comments as $comment)

{{ucfirst($comment->name)}}

{{date('F jS, Y - g:i a',strtotime($comment->created_at))}}

@if(Auth::user()->is_admin == 1 || $comment->user_id == Auth::user()->id) @endif   
{{$comment->comment}}

@foreach($comment->subcomments as $subcomment)
@php $name=App\User::where('id',$subcomment->user_id)->first(); @endphp
{{ucfirst($name->name)}}

{{date('F jS, Y - g:i a',strtotime($subcomment->created_at))}}

@if(Auth::user()->is_admin == 1 || $subcomment->user_id == Auth::user()->id) @endif
{{$subcomment->reply}}
@endforeach @endforeach
@auth

{{__('postcomment')}}:


{{Form::open( ['route' => ['comment.store', $blogdetail->id], 'method' => 'POST'])}} {{Form::label('comment',__('Comment'))}} {{Form::textarea('comment', null, ['class' => 'form-control', 'rows'=> '5','cols' => '10'])}}
{{Form::submit(__('add comment'), ['class' => 'btn btn-md btn-primary'])}}
@endauth
@endif
@endsection @section('custom-script') @endsection