@extends('layouts.app') @section('content')

Product Management

@if(session('success')) @endif
@if($products->count() > 0)
@foreach($products as $product) @endforeach
Thumbnail Title Category Submitted By Status Date Actions
@if($product->thumbnail_url) {{ $product->title }} @else
No img
@endif
{{ $product->title }}
{{ Str::limit($product->description, 60) }}
{{ $product->category->name }} {{ $product->user->name }} @if($product->isPending()) Pending @elseif($product->isApproved()) Approved @elseif($product->isRejected()) Rejected @endif {{ $product->created_at->format('M j, Y') }}
{{ $product->created_at->diffForHumans() }}
@if($product->isPending() || $product->isRejected())
@csrf
@endif @if($product->isPending() || $product->isApproved())
@csrf
@endif 👁 @can('edit-product', $product) ✎ @endcan @can('delete-product', $product)
@csrf @method('DELETE')
@endcan
{{ $products->appends(['status' => request('status')])->links() }}
@else
No products found with status: {{ request('status', 'pending') }}
@endif
@endsection