From 31a846e2849c2153427bebb87a2819f4a089d174 Mon Sep 17 00:00:00 2001 From: Ibrahim Khalil Shakil Date: Tue, 26 Dec 2023 00:04:22 +0600 Subject: [PATCH] added search by category --- resources/views/frontend/searchCourse.blade.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/views/frontend/searchCourse.blade.php b/resources/views/frontend/searchCourse.blade.php index b4e4b33..ebc113c 100644 --- a/resources/views/frontend/searchCourse.blade.php +++ b/resources/views/frontend/searchCourse.blade.php @@ -70,19 +70,23 @@ !$selectedCategoryId ? 'checked' : '' }}>

- 1,54,750 + {{ $course->count() }}

@forelse($category as $cat) + @php + // Fetch the count of courses for each category + $courseCount = $cat->course()->count(); + @endphp
id - ? 'checked' : '' }}> + value="{{ $cat->id }}" {{$selectedCategoryId==$cat->id ? 'checked' : + ''}}>

- 45,770 + {{$courseCount}}

@empty