diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index a59d878..e143976 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -234,21 +234,21 @@ class ProductController extends Controller { // Static announcements for now - can be moved to database later $announcements = [ - [ - 'icon' => '🎉', - 'message' => 'Free Shipping on orders over $250', - 'detail' => "Don't miss a discount!", - ], - [ - 'icon' => '💰', - 'message' => 'Money back guarantee', - 'detail' => 'We return money within 30 days', - ], - [ - 'icon' => '💪', - 'message' => 'Friendly 24/7 customer support', - 'detail' => "We've got you covered!", - ], + // [ + // 'icon' => '🎉', + // 'message' => 'Free Shipping on orders over $250', + // 'detail' => "Don't miss a discount!", + // ], + // [ + // 'icon' => '💰', + // 'message' => 'Money back guarantee', + // 'detail' => 'We return money within 30 days', + // ], + // [ + // 'icon' => '💪', + // 'message' => 'Friendly 24/7 customer support', + // 'detail' => "We've got you covered!", + // ], ]; // Render announcement slides HTML diff --git a/app/Models/Gender.php b/app/Models/Gender.php index ed50549..7f9e4ab 100644 --- a/app/Models/Gender.php +++ b/app/Models/Gender.php @@ -21,4 +21,16 @@ class Gender extends Model protected $primaryKey = 'id'; protected $fillable = ['name', 'image']; + + + + public function items() + { + return $this->hasMany(Items::class, 'gender_id', 'id'); + } + + public function productCount() + { + return $this->items()->count(); + } } diff --git a/app/Repositories/Catalog/GenderRepository.php b/app/Repositories/Catalog/GenderRepository.php index 16d5a8d..8846d75 100644 --- a/app/Repositories/Catalog/GenderRepository.php +++ b/app/Repositories/Catalog/GenderRepository.php @@ -30,6 +30,7 @@ class GenderRepository $ids = collect($ids)->pluck("gender"); return Gender::whereIn("name",$ids)->get(); } + return Gender::get(); } } diff --git a/app/View/Components/Grocery/FeaturedCategories.php b/app/View/Components/Grocery/FeaturedCategories.php index 2835797..f036638 100644 --- a/app/View/Components/Grocery/FeaturedCategories.php +++ b/app/View/Components/Grocery/FeaturedCategories.php @@ -5,15 +5,18 @@ namespace App\View\Components\Grocery; use Closure; use Illuminate\Contracts\View\View; use Illuminate\View\Component; +use App\Repositories\Catalog\GenderRepository; class FeaturedCategories extends Component { + protected $genders = []; + /** * Create a new component instance. */ - public function __construct() + public function __construct(GenderRepository $genderRepository) { - // + $this->genders = $genderRepository->getList([]); } /** @@ -21,6 +24,8 @@ class FeaturedCategories extends Component */ public function render(): View|Closure|string { - return view('components.grocery.featured-categories'); + return view('components.grocery.featured-categories',[ + "genders" => $this->genders, + ]); } } diff --git a/public/img/banner01.png b/public/img/banner01.png new file mode 100644 index 0000000..7d56255 Binary files /dev/null and b/public/img/banner01.png differ diff --git a/public/img/banner02.png b/public/img/banner02.png new file mode 100644 index 0000000..37aa72c Binary files /dev/null and b/public/img/banner02.png differ diff --git a/public/img/thumbnail_demo.png b/public/img/thumbnail_demo.png new file mode 100644 index 0000000..b098b32 Binary files /dev/null and b/public/img/thumbnail_demo.png differ diff --git a/resources/views/components/grocery/featured-categories.blade.php b/resources/views/components/grocery/featured-categories.blade.php index 0f647eb..cbccf6e 100644 --- a/resources/views/components/grocery/featured-categories.blade.php +++ b/resources/views/components/grocery/featured-categories.blade.php @@ -18,71 +18,29 @@ }'>
+
+
+
+ style="--cz-aspect-ratio: calc(244 / 244 * 100%); max-width: 244px">
+