@extends('main') @section('title' , "| $titleTag ") @section('content')

{{ $post->title }}

{!! $post->body !!}


Kategoria: {{ $post->category->name }}

Autor postu: {{ $post->user->name }}

{{ $post->comments()->count() }} @if ($post->comments()->count() == 0 ) Komentarzy @elseif ($post->comments()->count() == 1 ) Komentarz @elseif ($post->comments()->count() >= 2 && $post->comments()->count() <= 4 ) Komentarze @elseif ($post->comments()->count() >= 5 ) Komentarzy @endif

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

{{ $comment->user->name }}

{{ date('F nS, Y - G:i' , strtotime($comment->created_at)) }}

{{ $comment->comment }}
@endforeach
@if (Sentinel::check())
{{ Form::open(['route' => ['comments.store' , $post->id] , 'method' => 'POST' ]) }}
{{ Form::label('comment' , "Komentarz:") }} {{ Form::textarea('comment' , null , ['class' => 'form-control' , 'rows' => '5']) }} {{ Form::submit('Dodaj Komentarz' , ['class' => 'btn btn-success btn-block' , 'style' => 'margin-top:15px;']) }}
{{ Form::close() }}
@endif @stop