From 308f226ca0e09a65729dd8bbc42b7a9bcd392e98 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Tue, 22 Feb 2022 22:46:10 +0100 Subject: [PATCH] fix empty --- resources/views/Shop/Articles/show.blade.php | 62 +++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/resources/views/Shop/Articles/show.blade.php b/resources/views/Shop/Articles/show.blade.php index 96c7fc24..e9f9dd0e 100644 --- a/resources/views/Shop/Articles/show.blade.php +++ b/resources/views/Shop/Articles/show.blade.php @@ -14,39 +14,45 @@ {!! $article['description'] !!}
- @component('components.card', [ - 'title' => 'Semence', - 'class' => 'mb-3', - ]) - {{ $article['offers']['semences']['name'] }}
- {{ $article['offers']['semences']['prices'][0]['price_taxed'] }}
- @include('components.form.button', [ - 'class' => 'btn-success basket semences', - 'txt' => 'Ajouter au panier', + @if ($article['offers']['semences'] ?? false) + @component('components.card', [ + 'title' => 'Semence', + 'class' => 'mb-3', ]) - @endcomponent + {{ $article['offers']['semences']['name'] }}
+ {{ $article['offers']['semences']['prices'][0]['price_taxed'] }}
+ @include('components.form.button', [ + 'class' => 'btn-success basket semences', + 'txt' => 'Ajouter au panier', + ]) + @endcomponent + @endif - @component('components.card', [ - 'title' => 'Plant', - 'class' => 'mb-3', - ]) - {{ $article['offers']['plants']['name'] }}
- {{ $article['offers']['plants']['prices'][0]['price_taxed'] }}
- @include('components.form.button', [ - 'class' => 'btn-success basket plants', - 'txt' => 'Ajouter au panier', + @if ($article['offers']['plants'] ?? false) + @component('components.card', [ + 'title' => 'Plant', + 'class' => 'mb-3', ]) - @endcomponent + {{ $article['offers']['plants']['name'] }}
+ {{ $article['offers']['plants']['prices'][0]['price_taxed'] }}
+ @include('components.form.button', [ + 'class' => 'btn-success basket plants', + 'txt' => 'Ajouter au panier', + ]) + @endcomponent + @endif - @component('components.card', [ - 'title' => 'Légume', - 'class' => 'mb-3', - ]) - @include('components.form.button', [ - 'class' => 'btn-success basket legumes', - 'txt' => 'Ajouter au panier', + @if ($article['offers']['legumes'] ?? false) + @component('components.card', [ + 'title' => 'Légume', + 'class' => 'mb-3', ]) - @endcomponent + @include('components.form.button', [ + 'class' => 'btn-success basket legumes', + 'txt' => 'Ajouter au panier', + ]) + @endcomponent + @endif