@extends('layouts.bootstrap') @section('title', 'Products') @section('header')

Products

@if(auth()->user()->canManage())
Add Product
@endif Export CSV
@endsection @section('content')
@if(session('success')) @endif
All Products {{ $products->total() }}
@if($products->count() > 0)
@foreach($products as $product) @endforeach
Product Name Status Category Subcategory Country Price Unit Created By Created Actions
{{ $product->name }} @if($product->description)
{{ Str::limit($product->description, 50) }} @endif
@if($product->isComplete()) Complete @else Incomplete
{{ $product->getCompletionPercentage() }}% done @endif
{{ $product->category->name ?? '-' }} {{ $product->subcategory->name ?? '-' }} {{ $product->country_of_origin ?? '-' }} @if($product->price) ${{ number_format($product->price, 2) }} @else - @endif @if($product->measurement_unit) {{ $product->measurement_unit }} @else - @endif {{ $product->creator->name }} {{ $product->created_at->format('M d, Y') }}
@if(auth()->user()->canManage()) @if($product->isIncomplete()) Complete @endif @endif
@if(auth()->user()->canManage()) @endif
@if($products->hasPages())
Showing {{ $products->firstItem() ?? 0 }} to {{ $products->lastItem() ?? 0 }} of {{ $products->total() }} results
per page
@if($products->lastPage() > 10)
Go to page
@endif @endif @else

No Products Found

@if(request()->hasAny(['search', 'category_id', 'subcategory_id'])) Try adjusting your filters or search terms. @else Get started by adding your first product. @endif

@if(auth()->user()->canManage()) Add Product @endif
@endif
@endsection @push('scripts') @endpush