@extends('layouts.main') @section('title', $category->name) @section('content')
@if($category->image_path)
{{ $category->name }}

{{ $category->name }}

@else

{{ $category->name }}

@endif @if($category->description)

{{ $category->description }}

@endif
@forelse($products as $product)
@if($product->coverImage) {{ $product->name }} @endif

{{ $product->name }}

{{ Str::limit($product->description, 80) }}

@php $currentPrice = $product->getCurrentPrice(); $basePrice = $product->price; @endphp @if($currentPrice < $basePrice)
₺{{ number_format($currentPrice, 2) }} ₺{{ number_format($basePrice, 2) }}
@else ₺{{ number_format($currentPrice, 2) }} @endif
@if($product->allergens->count() > 0)

Allergens:

@foreach($product->allergens as $allergen) {{ $allergen->name }} @endforeach
@endif
@csrf
@empty

No products available in this category.

@endforelse
@if($products->hasPages())
{{ $products->links() }}
@endif
@endsection