Closes #28 Product.show banner is dynamic

This commit is contained in:
Jérémy Munsch 2023-10-23 11:58:02 +02:00
parent 506bf2f90b
commit 79a4e573cb
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 6 additions and 5 deletions

View file

@ -35,7 +35,7 @@ class ProductsController extends Controller
$q->where('id', $publishedRange->id);
})
->where('status', true)
->paginate(9);
->paginate(9);
return view('fo.pages.products.range-products', [
'products' => $products,
@ -51,6 +51,7 @@ class ProductsController extends Controller
*/
public function show(Product $publishedProduct)
{
$publishedProduct->load('range');
$certifications = $publishedProduct->certifications()->where('status', true)->get();
$associatedRecipes = $publishedProduct->recipes()->where('status', true)->take(3)->get();
$productModel = $publishedProduct;

View file

@ -13,8 +13,8 @@
<div class="g-0 pb-md-5 position-relative hero">
<div class="position-relative hero-fix-height">
<img class="img-fluid" src="{{ Vite::asset('resources/assets/images/Panoramique3.jpg') }}"
alt="Une assiette de merguez de volailles accompagnées de tomates cerise coupées, d'oigons tranchés et de persil">
<img class="img-fluid w-100" src="{{ asset($productModel->range->banner) }}" title="{{ $productModel->range->banner_title }}"
alt="{{ $productModel->range->banner_alt }}">
</div>
<!-- breadcrumb -->
<div class="breadcrumb-obj small container mt-3">
@ -35,8 +35,8 @@
<div class="container">
<div class="row g-5">
<div class="col-md-6">
<img class="img-fluid img-cut" src="{{ asset($productModel->picture) }}"
title="{{ $productModel->picture_title }}" alt="{{ $productModel->picture_alt }}">
<img class="img-fluid img-cut" src="{{ asset($productModel->picture) }}" title="{{ $productModel->picture_title }}"
alt="{{ $productModel->picture_alt }}">
<div class="container mt-4">
<div class="row img-80">
@if (isset($productModel->info_cooking))