1
0
Fork 0

Update CommentController

This commit is contained in:
Daniel Supernault 2020-02-18 00:19:18 -07:00
parent 6a16559132
commit 81f4ccf979
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
2 changed files with 1 additions and 46 deletions

View File

@ -23,11 +23,7 @@ class CommentController extends Controller
{
public function showAll(Request $request, $username, int $id)
{
$profile = Profile::whereNull(['status', 'domain'])->whereUsername($username)->firstOrFail();
$status = Status::whereProfileId($profile->id)->findOrFail($id);
$replies = Status::whereInReplyToId($id)->simplePaginate(40);
return view('status.comments', compact('profile', 'status', 'replies'));
abort(404);
}
public function store(Request $request)

View File

@ -1,41 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container px-0 mt-md-4">
<div class="col-12 col-md-8 offset-md-2">
<div class="card shadow-none border">
<div class="card-body">
<p class="mb-0">
<img class="img-thumbnail mr-2" src="{{$profile->avatarUrl()}}" width="24px" height="24px" style="border-radius:24px;">
<span class="font-weight-bold pr-1"><bdi><a class="text-dark" href="{{$status->profile->url()}}">{{ str_limit($status->profile->username, 15)}}</a></bdi></span>
<span class="comment-text">{!! $status->rendered ?? e($status->caption) !!} <a href="{{$status->url()}}" class="text-dark small font-weight-bold float-right pl-2">{{$status->created_at->diffForHumans(null, true, true ,true)}}</a></span>
</p>
<p class="text-center font-weight-bold text-muted small text-uppercase pt-3">All Comments</p>
<div class="comments">
@foreach($replies as $item)
<p class="mb-2">
<span class="font-weight-bold pr-1">
<img class="img-thumbnail mr-2" src="{{$item->profile->avatarUrl()}}" width="24px" height="24px" style="border-radius:24px;">
<bdi><a class="text-dark" href="{{$item->profile->url()}}">{{ str_limit($item->profile->username, 15)}}</a></bdi>
</span>
<span class="comment-text">
{!! $item->rendered ?? e($item->caption) !!}
<a href="{{$item->url()}}" class="text-dark small font-weight-bold float-right pl-2">
{{$item->created_at->diffForHumans(null, true, true ,true)}}
</a>
</span>
</p>
@endforeach
</div>
</div>
</div>
<div class="mt-2 d-flex justify-content-center">
{{ $replies->links() }}
</div>
</div>
</div>
@endsection