Harden
This commit is contained in:
@@ -15,6 +15,25 @@
|
||||
<p class="text-sm text-gray-500">{{ $post->user->name }} | {{ $post->created_at->diffForHumans() }}</p>
|
||||
@if ($post->title)<h3 class="mt-2 font-semibold">{{ $post->title }}</h3>@endif
|
||||
<p class="mt-3 whitespace-pre-line">{{ $post->body }}</p>
|
||||
<x-attachments :attachments="$post->attachments" />
|
||||
@auth
|
||||
@if ($post->user_id === auth()->id())
|
||||
<x-attachment-form type="social_post" :id="$post->id" kind="post" />
|
||||
@endif
|
||||
<form method="POST" action="{{ route('comments.store') }}" class="mt-4 space-y-3">
|
||||
@csrf
|
||||
<input type="hidden" name="commentable_type" value="social_post">
|
||||
<input type="hidden" name="commentable_id" value="{{ $post->id }}">
|
||||
<x-field name="body" label="Comment" textarea />
|
||||
<x-primary-button>Comment</x-primary-button>
|
||||
</form>
|
||||
@endauth
|
||||
@foreach ($post->comments as $comment)
|
||||
<div class="mt-3 rounded bg-gray-50 p-3 text-sm">
|
||||
<p class="font-semibold">{{ $comment->user->name }}</p>
|
||||
<p class="whitespace-pre-line">{{ $comment->body }}</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</article>
|
||||
@endforeach
|
||||
{{ $posts->links() }}
|
||||
|
||||
Reference in New Issue
Block a user