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

{{ session('success') }}

@endif

{{ $product->title }}

@if($product->isPending()) Pending Review @elseif($product->isApproved()) Approved @elseif($product->isRejected()) Rejected @endif
{{ $product->category->name }} • by {{ $product->user->name }} • {{ $product->created_at->format('M j, Y') }}
@auth @else
{{ $product->upvotes()->count() }}
@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 }}

@if($product->isApproved() && $product->approved_at)
Submitted on
{{ $product->created_at->format('F j, Y') }}
Approved on
{{ $product->approved_at->format('F j, Y') }}
Category
{{ $product->category->name }}
@endif

Comments ({{ $product->comments()->count() }})

@auth
@csrf
@error('body')

{{ $message }}

@enderror
@else

Log in 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 share your thoughts!

@endforelse
@can('approve-product') @if($product->isPending() || $product->isRejected())

Moderator Actions

@csrf
@csrf
@endif @endcan
Back to Products
@push('scripts') @endpush @endsection