This commit is contained in:
Codex
2026-07-10 10:38:02 -05:00
parent 63820994f8
commit 42db078e47
51 changed files with 1173 additions and 26 deletions
+19
View File
@@ -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() }}