Liste des sections @php $titre1 = \App\Models\Configuration::query()->where('label', 'titre_1')->value('value'); $color = \App\Models\Configuration::query()->where('label', 'color')->value('value'); $sectionCount1 = \App\Models\Home::where('section', "1")->count(); $sectionCount2 = \App\Models\Home::where('section', "2")->count(); $sectionCount3 = \App\Models\Home::where('section', "3")->count(); $configuration = \App\Models\Configuration::query()->where("label", "Configuration modules")->first(); $configValues = json_decode($configuration->value); $para = $configValues->para ?? false; $onlyPara = $configValues->onlypara ?? false; // Debugging to ensure correct values are being assigned $section1Display = false; $section2Display = false; $section3Display = false; if ($para === false) { $section1Display = false; $section2Display = true; $section3Display = false; } else if ($para === true && $onlyPara === true) { $section1Display = false; $section2Display = false; $section3Display = true; } else { $section1Display = true; $section2Display = false; $section3Display = false; } // Debugging section display values to verify conditions @endphp Liste des sections @if($section1Display == true)
@if($color != '#ffffff')
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@else
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@endif
@php $titre2 = \App\Models\Configuration::query()->where('label', 'titre_2')->first()->value; @endphp
@if($color != '#ffffff')
{{$titre2}}

{{$sectionCount2}}/8

Gestion des produits
@else
{{$titre2}}

{{$sectionCount2}}/8

Gestion des produits
@endif
@php $titre3 = \App\Models\Configuration::query()->where('label', 'titre_3')->first()->value; @endphp
@if($color != '#ffffff')
{{$titre3}}

{{$sectionCount3}}/8

Gestion des produits
@else
{{$titre3}}

{{$sectionCount1}}/8

Gestion des produits
@endif
@endif @if($section2Display == true)
@php $titre1 = \App\Models\Configuration::query()->where('label', 'titre_1')->value('value'); $color = \App\Models\Configuration::query()->where('label', 'color')->value('value'); $sectionCount1 = \App\Models\Home::where('section', "1")->count(); $sectionCount2 = \App\Models\Home::where('section', "2")->count(); $sectionCount3 = \App\Models\Home::where('section', "3")->count(); @endphp
@if($color != '#ffffff')
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@else
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@endif
@php $titre2 = \App\Models\Configuration::query()->where('label', 'titre_2')->first()->value; @endphp
@if($color != '#ffffff')
{{$titre2}}

{{$sectionCount2}}/16

Gestion des produits
@else
{{$titre2}}

{{$sectionCount2}}/16

Gestion des produits
@endif
@endif @if($section3Display == true)
@php $titre1 = \App\Models\Configuration::query()->where('label', 'titre_1')->value('value'); $color = \App\Models\Configuration::query()->where('label', 'color')->value('value'); $sectionCount1 = \App\Models\Home::where('section', "1")->count(); $sectionCount2 = \App\Models\Home::where('section', "2")->count(); $sectionCount3 = \App\Models\Home::where('section', "3")->count(); @endphp
@if($color != '#ffffff')
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@else
{{$titre1}}

{{$sectionCount1}}/8

Gestion des produits
@endif
@php $titre3 = \App\Models\Configuration::query()->where('label', 'titre_3')->first()->value; @endphp
@if($color != '#ffffff')
{{$titre3}}

{{$sectionCount3}}/16

Gestion des produits
@else
{{$titre3}}

{{$sectionCount1}}/16

Gestion des produits
@endif
@endif