diff --git a/app/Http/Controllers/HomePageController.php b/app/Http/Controllers/HomePageController.php new file mode 100644 index 0000000..ebc0fac --- /dev/null +++ b/app/Http/Controllers/HomePageController.php @@ -0,0 +1,26 @@ +', now()) + ->where('is_hidden', false) + ->orderBy('end_date', 'asc') + ->take(3) + ->get(); + + // get the top 3 popular services using most bookings in the last 30 days + $popularServices = \App\Models\Service::withCount('appointments') + ->orderBy('appointments_count', 'desc') + ->take(3) + ->where('is_hidden', false) + ->get(); + + + return view('web.home', compact('deals', 'popularServices')); + } +} diff --git a/database/database.sqlite b/database/database.sqlite index 6663c32..fe09c9a 100644 Binary files a/database/database.sqlite and b/database/database.sqlite differ diff --git a/resources/views/web/home.blade.php b/resources/views/web/home.blade.php index b8fa1c4..eebc196 100644 --- a/resources/views/web/home.blade.php +++ b/resources/views/web/home.blade.php @@ -89,76 +89,20 @@ class="block w-full rounded bg-white px-12 py-3 text-lg font-medium text-pink-50
Types of hair cuts available: Layered, Bangs, Pixie cut.
- -LKR 3,600.00
-LKR 4,000.00
-10% off
-Get your hair colored by our professional hair stylists.
- -LKR 3,600.00
-LKR 4,000.00
-10% off
-Keep those fingernails stylish
- -LKR 3,600.00
-LKR 4,000.00
-10% off
-+ No Services Found +
+ @endif+ No Deals Found +
+ @endif