@php
$query = request()->input('query');
$category = request()->input('category');
$productCount =
$query !== null
? App\Models\Products::where('model', $query)
->where('slug', null)
->count()
: ($category !== null
? App\Models\Products::whereIn('category', $category)
->where('slug', null)
->count()
: App\Models\Products::where('slug', null)->count());
@endphp
{{ $productCount }}
Products Found
{{-- search --}}