diff --git a/app/Http/Controllers/ShopController.php b/app/Http/Controllers/ShopController.php index c82462a..b8efc30 100644 --- a/app/Http/Controllers/ShopController.php +++ b/app/Http/Controllers/ShopController.php @@ -25,12 +25,8 @@ public function index() public function show($slug) { $product = Product::where('slug', $slug) - ->with('media', 'category') + ->with('category') ->firstOrfail(); - $images = $product->images() - ->with('media') - ->get(); - $image_count = $images->count(); $auth = Auth::guard('customer')->user() ? Auth::guard('customer')->user()->id : null; @@ -41,6 +37,6 @@ public function show($slug) ->with('media') ->take(8) ->get(); - return view('show', compact('product', 'image_count', 'images', 'auth', 'similar')); + return view('show', compact('product', 'auth', 'similar')); } } diff --git a/app/Http/Controllers/WelcomeController.php b/app/Http/Controllers/WelcomeController.php index 0a7b8a3..57cefbe 100644 --- a/app/Http/Controllers/WelcomeController.php +++ b/app/Http/Controllers/WelcomeController.php @@ -17,7 +17,6 @@ public function index() $new = Product::latest() ->where('published', true) ->has('attributes') - ->with('media', 'images') ->paginate(6)->lazy(); return view('welcome', compact('new')); } diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index c71fc91..e6dc361 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -48,41 +48,7 @@ class=" "> @forelse($new as $product)
- {{--
-
- - {{ $product->slug }} - -
-
- -
- -
- -

- {{ $product->name }} -

-
-

- RS {{ $product->min }} + - NP -

- -
- - @if(!$product->attributes()->sum('quantity')) -
- Out of Stock -
- @endif - -
--}} +