@extends('front.layouts.main') @section('title', 'Kua Products') @push('pageCss') @endpush @section('content')
{{-- Header --}}

Products

{{-- Search and Pagination Form --}}
{{-- THIS IS THE CORRECTION: Use total() for paginated collections --}} Total {{ $products->total() }}
@if($products->count() > 0) {{-- products Table --}}
@php $currentSort = request('sort_by'); $currentOrder = request('order') === 'asc' ? 'desc' : 'asc'; @endphp @foreach($products as $product)
Client @if ($currentSort === 'client') @else @endif Product @if ($currentSort === 'product_name') @else @endif Commission Agreement Product Documents