@extends('layouts.app') @section('content')
@if(session('success')) @endif

{{ $product->title }}

{{ $product->category->name }} @if($product->isPending()) Pending Review @elseif($product->isApproved()) Approved @elseif($product->isRejected()) Rejected @endif

@auth @else
{{ $product->upvotes()->count() }} upvotes
@endauth @can('edit-product', $product) Edit @endcan @can('delete-product', $product)
@csrf @method('DELETE')
@endcan
@if($product->thumbnail_url)
{{ $product->title }}
@endif

About

{{ $product->description }}


Submitted: {{ $product->created_at->format('F j, Y') }}
@if($product->isApproved() && $product->approved_at)
Approved: {{ $product->approved_at->format('F j, Y') }}
@endif
Comments ({{ $product->comments()->count() }})
@auth
@csrf
@error('body') {{ $message }} @enderror
@else

Login to post a comment.

@endauth @forelse($product->comments as $comment)
@if($comment->user->avatar_url) {{ $comment->user->name }} @else
{{ strtoupper(substr($comment->user->name, 0, 1)) }}
@endif
{{ $comment->user->name }} · {{ $comment->created_at->diffForHumans() }}
@can('delete-comment', $comment)
@csrf @method('DELETE')
@endcan

{{ $comment->body }}

@empty

No comments yet. Be the first to comment!

@endforelse
@can('approve-product') @if($product->isPending() || $product->isRejected())
Moderator Actions
@csrf
@csrf
@endif @endcan
@push('styles') @endpush @push('scripts') @endpush @endsection