@extends('layouts.bootstrap') @section('title', 'Subcategory: ' . $subcategory->name) @section('header')

{{ $subcategory->name }}

@if(auth()->user()->canManage()) Edit @endif Back to Subcategories
@endsection @section('content')
Subcategory Information
Name: {{ $subcategory->name }}
Category: {{ $subcategory->category->name }}
Products: {{ $subcategory->products->count() }}
Created: {{ $subcategory->created_at->format('M d, Y H:i') }}
Updated: {{ $subcategory->updated_at->format('M d, Y H:i') }}
Products in this Subcategory
@if(auth()->user()->canManage()) Add Product @endif
@if($subcategory->products->count() > 0)
@foreach($subcategory->products->take(10) as $product) @endforeach
Product Name Country Price Created Actions
{{ $product->name }} @if($product->description)
{{ Str::limit($product->description, 50) }} @endif
{{ $product->country_of_origin ?? '-' }} @if($product->price) ${{ number_format($product->price, 2) }} @else - @endif {{ $product->created_at->format('M d, Y') }}
@if(auth()->user()->canManage()) @endif
@if($subcategory->products->count() > 10) @endif @else

No products found in this subcategory.

@if(auth()->user()->canManage()) Add Product @endif
@endif
@endsection