Add Gamme Model (2/2)

This commit is contained in:
Sebastien Hattry 2021-12-21 17:30:39 +01:00
parent daad721b17
commit e073d9b6ff
22 changed files with 4349 additions and 300 deletions

View file

@ -16,8 +16,18 @@ class GammesController extends Controller
*/
public function index()
{
$gammes = Gamme::orderBy('created_at', 'DESC')->get();
// $gammes = Gamme::whereNull('parent_id')->orderBy('created_at', 'DESC')->get();
$gammes = collect([]);
$dbGammes = Gamme::orderBy('title')->whereNull('parent_gamme_id')
->with('childGammes')->get();
/** @var \App\Models\Gamme $gamme */
foreach ($dbGammes as $gamme) {
$gammes->push($gamme);
$gamme->childGammes->sortBy('title')
->map(function (Gamme $childGamme) use (&$gammes) {
$gammes->push($childGamme);
});
}
return view('back.gammes.index', compact('gammes'));
}
@ -31,7 +41,11 @@ class GammesController extends Controller
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
public function create(Gamme $gamme)
{
return view('back.gammes.create', compact('gamme'));
$parentGammes = Gamme::whereNull('parent_gamme_id')
->where('id', '!=', $gamme->id)
->orderBy('created_at', 'DESC')->get();
return view('back.gammes.create', compact('gamme', 'parentGammes'));
}
/**
@ -43,12 +57,8 @@ class GammesController extends Controller
public function store(StoreGammeRequest $request)
{
$gamme = new Gamme($request->validated());
$response = $this->changeUniquePostOnTop($gamme->on_top);
if ($response) {
$response = $gamme->saveOrFail();
}
if (!$response) {
if (!$gamme->saveOrFail()) {
return redirect()->route('bo.gammes.edit', $gamme->id)->with('error', 'L\'actualité n\'a pas été créee');
}
return redirect()->route('bo.gammes.edit', $gamme->id)->with('success', 'Actualité créée !');
@ -63,7 +73,11 @@ class GammesController extends Controller
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
public function edit(Gamme $gamme)
{
return view('back.gammes.edit', compact('gamme'));
$parentGammes = Gamme::whereNull('parent_gamme_id')
->where('id', '!=', $gamme->id)
->orderBy('created_at', 'DESC')->get();
return view('back.gammes.edit', compact('gamme', 'parentGammes'));
}
/**
@ -77,12 +91,7 @@ class GammesController extends Controller
{
$gamme->fill($request->validated());
$response = $this->changeUniquePostOnTop($gamme->on_top);
if ($response) {
$response = $gamme->saveOrFail();
}
if (!$response) {
if (!$gamme->saveOrFail()) {
return redirect()->route('bo.gammes.edit', $gamme->id)
->with('error', trans('La modification a échoué'));
}

View file

@ -7,6 +7,7 @@ use Illuminate\Http\Request;
use App\Enums\Page;
use App\Models\Advice;
use App\Models\Encart;
use App\Models\Gamme;
use App\Models\Picto;
use App\Models\PictoBrand;
use App\Models\Post;
@ -61,6 +62,9 @@ class InitVarsGlobals
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
$title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
// GAMMES, SOUS-GAMMES, PRODUITS
$gammes = Gamme::whereNull('parent_gamme_id')->get();
View::share('encart_home', $encart_home);
View::share('encart_marqueHeader', $encart_marqueHeader);
View::share('encart_marqueBloc2', $encart_marqueBloc2);
@ -87,6 +91,9 @@ class InitVarsGlobals
View::share('title_foodBloc2', $title_foodBloc2);
View::share('title_newsPosts', $title_newsPosts);
View::share('gammes', $gammes);
View::share('nb_gammes', $gammes->count());
return $next($request);
}
}

View file

@ -3,6 +3,7 @@
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;
class StoreGammeRequest extends FormRequest
{
@ -13,6 +14,11 @@ class StoreGammeRequest extends FormRequest
*/
public function authorize()
{
$this->merge([
'slug' => Str::slug($this->title),
'parent_gamme_id' => $this->parent_gamme_id === '0' ? null : $this->parent_gamme_id,
]);
return auth()->check();
}
@ -24,14 +30,37 @@ class StoreGammeRequest extends FormRequest
public function rules()
{
return [
'parent_gamme_id' => 'required|exists:gammes,id',
'title' => 'required|max:255',
'text' => 'required|max:255',
'parent_gamme_id' => 'sometimes|nullable|exists:gammes,id',
'title' => 'required|string|max:255',
'slug' => 'required|unique:gammes',
'text' => 'required|string|max:255',
'color' => 'sometimes',
'picture' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=575,height=375',
'alt_text_picture' => 'required|max:255',
'alt_text_picture' => 'required|string|max:255',
'banner' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1169,height=243',
'alt_text_banner' => 'required|max:255',
'alt_text_banner' => 'required|string|max:255',
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public function messages()
{
return [];
}
/**
* Get custom attributes for validator errors.
*
* @return array
*/
public function attributes()
{
return [
'slug' => trans('Nom')
];
}
}

View file

@ -14,6 +14,7 @@ class UpdateGammeRequest extends StoreGammeRequest
return array_merge(
parent::rules(),
[
'slug' => 'required|unique:gammes,slug,' . $this->gamme->id,
'picture' => [
'sometimes',
'image',

View file

@ -11,8 +11,9 @@ class Gamme extends Model
use HasFactory;
protected $fillable = [
'parent_id',
'parent_gamme_id',
'title',
'slug',
'text',
'color',
'picture',
@ -30,6 +31,11 @@ class Gamme extends Model
if ($gamme->banner) {
$gamme->banner = Utils::storeImage($gamme->banner, $gamme->getTable());
}
if ($gamme->parent_gamme_id != null) {
// Si Creation gamme enfant sans enfant, alors il faut update sa couleur selon celle du parent
$gamme->color = Gamme::whereId($gamme->parent_gamme_id)->select(['color'])->first()->color;
}
});
static::updating(function (Gamme $gamme) {
@ -39,10 +45,42 @@ class Gamme extends Model
if ($gamme->banner) {
$gamme->banner = Utils::storeImage($gamme->banner, $gamme->getTable());
}
if ($gamme->parent_gamme_id === null) {
// Si Update gamme parente, alors il faut update la couleur des enfants
Gamme::whereParentGammeId($gamme->id)
->update(['color' => $gamme->color]);
} elseif ($gamme->childGammes()->exists()) {
/**
* Si Update gamme enfant qui a des enfants,
* alors il faut update sa couleur selon celle du parent
* et vider l'association parent/enfant des petits enfants
*/
$gamme->color = Gamme::whereId($gamme->parent_gamme_id)->select(['color'])->first()->color;
Gamme::whereParentGammeId($gamme->id)
->update(['parent_gamme_id' => null]);
} else {
// Si Update gamme enfant sans enfant, alors il faut update sa couleur selon celle du parent
$gamme->color = Gamme::whereId($gamme->parent_gamme_id)->select(['color'])->first()->color;
}
});
parent::boot();
}
public function getRgbaColorAttribute()
{
$color = $this->color;
if (!$color) {
return '';
}
if ($color[0] == '#') {
$color = substr($color, 1);
}
list($r, $g, $b) = array_map("hexdec", str_split($color, (strlen($color) / 3)));
return "rgba($r,$g,$b,.8)";
}
public function childGammes()
{
return $this->hasMany(Gamme::class, 'parent_gamme_id');

View file

@ -4,6 +4,7 @@ namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use SplFileInfo;
use Illuminate\Support\Str;
class GammeFactory extends Factory
{
@ -14,9 +15,12 @@ class GammeFactory extends Factory
*/
public function definition()
{
$title = $this->faker->word();
return [
'parent_gamme_id' => null,
'title' => $this->faker->word(),
'title' => $title,
'slug' => Str::slug($title),
'text' => $this->faker->text(5),
'color' => $this->faker->hexColor(),
'picture' => new SplFileInfo(resource_path('assets/images/cookrange.jpg')),

View file

@ -17,6 +17,7 @@ class CreateGammesTable extends Migration
$table->id();
$table->smallInteger('parent_gamme_id')->nullable();
$table->string('title');
$table->string('slug')->unique();
$table->string('text');
$table->string('color')->nullable();
$table->string('picture')->nullable();

View file

@ -5,6 +5,7 @@ namespace Database\Seeders;
use App\Models\Gamme;
use Illuminate\Database\Seeder;
use SplFileInfo;
use Illuminate\Support\Str;
class GammesSeeder extends Seeder
{
@ -27,13 +28,14 @@ class GammesSeeder extends Seeder
$gamme = new Gamme();
$id = $key + 1;
$gamme->parent_gamme_id = $id;
$gamme->title = 'lorem ipsum';
$gamme->text = 'lorem ipsum set doloris';
$gamme->title = 'lorem ipsum' . $id . $i;
$gamme->slug = Str::slug($gamme->title);
$gamme->text = 'lorem ipsum set doloris' . $id . $i;
$gamme->color = $value;
$gamme->picture = new SplFileInfo(resource_path('assets/images/cookrange.jpg'));
$gamme->alt_text_picture = 'lorem utus garis';
$gamme->alt_text_picture = 'lorem utus garis' . $id . $i;
$gamme->banner = new SplFileInfo(resource_path('assets/images/cat_bckg.jpg'));
$gamme->alt_text_banner = 'redus faros';
$gamme->alt_text_banner = 'redus faros' . $id . $i;
$gamme->save();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 145 KiB

File diff suppressed because it is too large Load diff

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View file

@ -107,130 +107,130 @@
}
.overlay {
background-color: rgba($color-brown, 0.8);
span {
color: $color-brown;
// text-shadow: 0px 0px 2px #000;
}
}
.is-brown {
header .content {
background-color: rgba($color-brown, 0.8);
}
.overlay {
background-color: rgba($color-brown, 0.8);
}
.product-card {
.overlay {
span {
color: $color-brown;
}
}
}
}
// .is-brown {
// header .content {
// background-color: rgba($color-brown, 0.8);
// }
// .overlay {
// background-color: rgba($color-brown, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-brown;
// }
// }
// }
// }
.is-orange {
header .content {
background-color: rgba($color-orange, 0.8);
}
.overlay {
background-color: rgba($color-orange, 0.8);
}
.product-card {
.overlay {
span {
color: $color-orange;
}
}
}
}
// .is-orange {
// header .content {
// background-color: rgba($color-orange, 0.8);
// }
// .overlay {
// background-color: rgba($color-orange, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-orange;
// }
// }
// }
// }
.is-grey {
header .content {
background-color: rgba($color-newgrey, 0.8);
}
.overlay {
background-color: rgba($color-newgrey, 0.8);
}
.product-card {
.overlay {
span {
color: $color-newgrey;
}
}
}
}
// .is-grey {
// header .content {
// background-color: rgba($color-newgrey, 0.8);
// }
// .overlay {
// background-color: rgba($color-newgrey, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-newgrey;
// }
// }
// }
// }
.is-yellow {
header .content {
background-color: rgba($color-main, 0.8);
}
.overlay {
background-color: rgba($color-main, 0.8);
}
.product-card {
.overlay {
span {
color: $color-main;
}
}
}
.gamme-card {
.overlay {
span {
color: $color-light;
}
}
}
}
// .is-yellow {
// header .content {
// background-color: rgba($color-main, 0.8);
// }
// .overlay {
// background-color: rgba($color-main, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-main;
// }
// }
// }
// .gamme-card {
// .overlay {
// span {
// color: $color-light;
// }
// }
// }
// }
.is-blue {
header .content {
background-color: rgba($color-newblue, 0.8);
}
.overlay {
background-color: rgba($color-newblue, 0.8);
}
.product-card {
.overlay {
span {
color: $color-newblue;
}
}
}
}
// .is-blue {
// header .content {
// background-color: rgba($color-newblue, 0.8);
// }
// .overlay {
// background-color: rgba($color-newblue, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-newblue;
// }
// }
// }
// }
.is-green {
header .content {
background-color: rgba($color-green, 0.8);
}
.overlay {
background-color: rgba($color-green, 0.8);
}
.product-card {
.overlay {
span {
color: $color-green;
}
}
}
}
// .is-green {
// header .content {
// background-color: rgba($color-green, 0.8);
// }
// .overlay {
// background-color: rgba($color-green, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-green;
// }
// }
// }
// }
.is-pink {
header .content {
background-color: rgba($color-pink, 0.8);
}
.overlay {
background-color: rgba($color-pink, 0.8);
}
.product-card {
.overlay {
span {
color: $color-pink;
}
}
}
}
// .is-pink {
// header .content {
// background-color: rgba($color-pink, 0.8);
// }
// .overlay {
// background-color: rgba($color-pink, 0.8);
// }
// .product-card {
// .overlay {
// span {
// color: $color-pink;
// }
// }
// }
// }
#posts {
position: relative;
@ -262,12 +262,34 @@
.posts-list {
align-items: initial;
}
.gamme-card,
.gammes-6 .gamme-card,
.gammes-7 .gamme-card {
&:nth-child(n) {
width: 32%;
max-width: 32%;
}
}
.gamme-card {
width: 32%;
max-width: 32%;
&:nth-child(4),
&:nth-child(5) {
&:nth-child(5),
&:nth-child(9),
&:nth-child(10) {
width: 49%;
max-width: 49%;
}
}
// .gammes-6 .gamme-card {
// &:nth-child(n) {
// width: 32%;
// max-width: 32%;
// }
// }
.gammes-7 .gamme-card {
&:nth-child(1),
&:nth-child(2),
&:nth-child(6),
&:nth-child(7) {
width: 49%;
max-width: 49%;
}

View file

@ -20,6 +20,7 @@
@import "list";
@import "punchline";
@import "newsletter";
@import "animate.css";
@import "animate";
@import "carrousel";
@import "carrousel2";

View file

@ -1,17 +1,17 @@
@extends('layouts.backend')
@section('content')
<form action="{{route('bo.slides.store')}}" method="POST" enctype="multipart/form-data">
<form action="{{route('bo.gammes.store')}}" method="POST" enctype="multipart/form-data">
@csrf
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2"><a href="{{route('bo.slides.index')}}" class="h2 text-decoration-none">
< </a> {{ __('Slides') }} <small class="text-muted">{{ __('Création') }}</small></h1>
<h1 class="h2"><a href="{{route('bo.gammes.index')}}" class="h2 text-decoration-none">
< </a> {{ __('Gamme') }} <small class="text-muted">{{ __('Création') }}</small></h1>
<div class="btn-toolbar mb-2 mb-md-0">
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
</div>
</div>
@include('back.slides.form-inputs')
@include('back.gammes.form-inputs')
</form>
@endsection

View file

@ -1,18 +1,18 @@
@extends('layouts.backend')
@section('content')
<form action="{{route('bo.slides.update', $slide->id)}}" method="POST" enctype="multipart/form-data">
<form action="{{route('bo.gammes.update', $gamme->id)}}" method="POST" enctype="multipart/form-data">
@method('PUT')
@csrf
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2"><a href="{{route('bo.slides.index')}}" class="h2 text-decoration-none">
< </a> {{ __('Slide') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
<h1 class="h2"><a href="{{route('bo.gammes.index')}}" class="h2 text-decoration-none">
< </a> {{ __('Gamme') }} <small class="text-muted">{{ __('Edition') }}</small></h1>
<div class="btn-toolbar mb-2 mb-md-0">
<button type="submit" class="btn btn-sm btn-primary">{{ __('Enregistrer') }}</a>
</div>
</div>
@include('back.slides.form-inputs')
@include('back.gammes.form-inputs')
</form>
@endsection

View file

@ -3,14 +3,14 @@
<input type="text" id="title" name="title" class="form-control" placeholder="{{ __('Nom') }} *" value="{{ old('title', $gamme->title ?? '') }}" required>
@include('back.modules.input-error', ['inputName'=>'title'])
</div>
<div class="form-group">
<div class="form-group mb-3">
<label for="name">{{ __('Texte') }}</label>
<input type="text" id="text" name="text" class="form-control" placeholder="{{ __('Texte') }} *" value="{{ old('text', $gamme->text ?? '') }}" required>
@include('back.modules.input-error', ['inputName'=>'text'])
</div>
<div class="form-group">
<label for="picture">{{ __('Vignette') }} <small class="text-muted">- JPEG/PNG, 1Mo max. Dimensions {{ Config::get('bo.gamme_image_maxwidth') }} px par {{ Config::get('bo.gamme_image_maxheight') }} px</small></label><br/>
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg" required>
<input type="file" id="picture" name="picture" accept="image/png, image/jpeg">
@if ($gamme->picture !== null)
<br/>
<br/>
@ -18,14 +18,14 @@
@endif
@include('back.modules.input-error', ['inputName'=>'picture'])
</div>
<div class="form-group">
<div class="form-group mb-3">
<label for="name">{{ __('Text alternatif de la vignette') }} *</label>
<input type="text" id="alt_text_picture" name="alt_text_picture" class="form-control" placeholder="{{ __('Texte alternatif de la vignette') }} *" value="{{ old('alt_text_picture', $gamme->alt_text_picture ?? '') }}" required>
@include('back.modules.input-error', ['inputName'=>'alt_text_picture'])
</div>
<div class="form-group">
<label for="banner">{{ __('Bannière') }} <small class="text-muted">- JPEG/PNG, 2Mo max. Dimensions {{ Config::get('bo.gamme_banner_maxwidth') }} px par {{ Config::get('bo.gamme_banner_maxheight') }} px</small></label><br/>
<input type="file" id="banner" name="banner" accept="image/png, image/jpeg" required>
<input type="file" id="banner" name="banner" accept="image/png, image/jpeg">
@if ($gamme->banner !== null)
<br/>
<br/>
@ -33,29 +33,29 @@
@endif
@include('back.modules.input-error', ['inputName'=>'banner'])
</div>
<div class="form-group">
<div class="form-group mb-3">
<label for="name">{{ __('Text alternatif de la bannière') }} *</label>
<input type="text" id="alt_text_banner" name="alt_text_banner" class="form-control" placeholder="{{ __('Texte alternatif de la bannière') }} *" value="{{ old('alt_text_banner', $gamme->alt_text_banner ?? '') }}" required>
@include('back.modules.input-error', ['inputName'=>'alt_text_banner'])
</div>
<div class="form-row">
<div class="form-row mb-3">
<div class="form-group col">
<label for="slider_id">{{ __('Gamme parente') }}</label>
<select class="custom-select" id="gamme_parent_id" name="gamme_parent_id">
<label for="parent_gamme_id">{{ __('Gamme parente') }}</label>
<select class="custom-select" id="parent_gamme_id" name="parent_gamme_id">
<option value="0">Pas de parent</option>
@foreach($gammes as $gamme)
<option value="{{$gamme->id}}" @if ($gamme->id === $gamme->gamme_parent_id) selected @endif>{{$gamme->title}}</option>
@foreach($parentGammes as $parentGamme)
<option value="{{$parentGamme->id}}" @if ($parentGamme->id === $gamme->parent_gamme_id) selected @endif>{{$parentGamme->title}}</option>
@endforeach
</select>
</div>
<div class="form-group col"></div>
<div class="form-group col"></div>
<div class="form-group col"></div>
@include('back.modules.input-error', ['inputName'=>'gamme_parent_id'])
@include('back.modules.input-error', ['inputName'=>'parent_gamme_id'])
</div>
<div class="form-group">
<label for="colorInput" class="form-label">Couleur de la gamme</label>
<input type="color" class="form-control form-control-color" name="colorInput" id="colorInput" value="#563d7c" title="Choisissez la couleur">
@include('back.modules.input-error', ['inputName'=>'colorInput'])
<label for="color" class="form-label">Couleur de la gamme</label>
<input type="color" class="form-control form-control-color" name="color" id="color" value="{{ old('color', $gamme->color ?? '') }}" @if ($gamme->parent_gamme_id != null) disabled @endif title="Choisissez la couleur">
@include('back.modules.input-error', ['inputName'=>'color'])
</div>

View file

@ -25,7 +25,11 @@
<tbody>
@foreach($gammes as $gamme)
<tr>
@if ($gamme->parent_gamme_id)
<td>- {{$gamme->title}}</td>
@else
<td>{{$gamme->title}}</td>
@endif
<td>{{$gamme->text}}</td>
<td><img src="{{ asset($gamme->picture) }}" height="50px"></td>
<td><input type="color" class="form-control form-control-color" id="exampleColorInput" value="{{$gamme->color}}" disabled></td>

View file

@ -5,10 +5,8 @@
@section('content')
<section class="jumbotron">
<p class="maintitle ttu animate__animated fadeIn animate__slow">Nos gammes produits
<!-- <span class="title-icon"><img src="{{ asset('assets/images/title-icon.png') }}" alt="icone"></span> -->
</p>
<img class="img-zoom" src="{{ asset('assets/images/entete_gammes.jpg') }}" alt="">
<p class="maintitle ttu animate__animated fadeIn animate__slow">Nos gammes produits</p>
<img class="img-zoom" src="{{ asset('assets/images/entete_gammes.jpg') }}" alt="Nos gammes de produits">
<div class="banner">
<svg id="Calque_1" data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1919.76 59.99">
<defs>
@ -31,14 +29,11 @@
<section class="container">
<div class="wrapper">
<div class="header-title align-center p-rel">
<!-- <h1 class="align-center">Qui sommes-nous ?</h1> -->
<h1 class="align-center animate__animated fadeInUp animate__slow">Toutes nos gammes</h1>
<div class="cuisto animate__animated fadeInLeft animate__slow">
<img src="{{ asset('assets/images/cuisto.jpg') }}" alt="Cuisinier avec un coq">
</div>
</div>
<!-- <h2 class="align-center sectiontitle">Nos produits de la gammes</h2> -->
<p class="align-center">Des produits incontournables, Authentiques et Innovants !</p>
</div>
</section>
@ -46,59 +41,16 @@
<section id="list" class="container">
<div class="wrapper align-center">
<div>
<!-- <header class="section-header p-rel">
<div class="content p-abs">
<h3 class="title ttu">Gamme family</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
</div>
<img src="{{ asset('assets/images/cat_bckg.jpg') }}" alt="">
</header> -->
<div class="is-flex">
<div class="gamme-card align-center is-brown">
<!-- <span class="label fresh"></span> -->
<img src="{{ asset('assets/images/volaille.jpg') }}" alt="">
<!-- <h3 class="gamme-card__title">Produit 1</h3> -->
<div class="is-flex horizontal-center @if ($nb_gammes) gammes-{{ $nb_gammes }} @endif ">
@foreach ($gammes as $gamme)
<div class="gamme-card align-center">
<img src="{{ asset($gamme->picture) }}" alt="{{ $gamme->alt_text_picture}}">
<a href="{{ route('categories') }}"></a>
<span class="overlay">
<span>Vollailes entières</span>
</span>
</div>
<div class="gamme-card align-center is-orange">
<!-- <span class="label fresh"></span> -->
<img src="{{ asset('assets/images/pranks.jpg') }}" alt="">
<!-- <h3 class="gamme-card__title">Bouchées de Volaille</h3> -->
<a href="{{ route('categories') }}"></a>
<span class="overlay">
<span>Franks</span>
</span>
</div>
<div class="gamme-card align-center is-grey">
<!-- <span class="label fresh"></span> -->
<img src="{{ asset('assets/images/decoupe.jpg') }}" alt="">
<!-- <h3 class="gamme-card__title">Bouchées de Volaille</h3> -->
<a href="{{ route('categories') }}"></a>
<span class="overlay">
<span>Découpe</span>
</span>
</div>
<div class="gamme-card align-center is-yellow">
<!-- <span class="label fresh"></span> -->
<img src="{{ asset('assets/images/restauration.jpg') }}" alt="">
<!-- <h3 class="gamme-card__title">Bouchées de Volaille</h3> -->
<a href="{{ route('categories') }}"></a>
<span class="overlay">
<span>Découpe</span>
</span>
</div>
<div class="gamme-card align-center is-blue">
<!-- <span class="label fresh"></span> -->
<img src="{{ asset('assets/images/cookrange.jpg') }}" alt="">
<!-- <h3 class="gamme-card__title">Bouchées de Volaille</h3> -->
<a href="{{ route('categories') }}"></a>
<span class="overlay">
<span>Découpe</span>
<span class="overlay" style="background-color: {{ $gamme->rgbaColor}};">
<span>{{ $gamme->title}}</span>
</span>
</div>
@endforeach
</div>
</div>
</div>