fix: 🐛 local page was not a static page

This commit is contained in:
K Muller 2026-07-09 09:57:52 +02:00
parent 0a94df329a
commit a7fa202f4c
5 changed files with 36 additions and 4 deletions

View file

@ -0,0 +1,33 @@
<?php
namespace App\View\Components;
use App\Enums\StaticPageType;
use App\Models\StaticPage;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class LocalBlockComponent extends Component
{
/** @var $staticPageModel \App\Models\StaticPage */
private $staticPageModel;
/**
* Create a new component instance.
*/
public function __construct()
{
$this->staticPageModel = StaticPage::query()->where('type', StaticPageType::our_commitments)->first();
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.local-block-component', [
'staticPageModel' => $this->staticPageModel
]);
}
}

View file

@ -60,6 +60,6 @@
</div>
<!-- LOCAL BLOCK -->
@include('fo.partials.local-block')
<x-local-block-component />
@endsection

View file

@ -38,8 +38,7 @@
</div>
</div>
<!-- LOCAL BLOCK -->
@include('fo.partials.local-block')
<x-local-block-component />
<!-- GAMMES -->
<div class="container-fluid pt-5 text-center">
<div class="row">

View file

@ -118,6 +118,6 @@
</div>
<!-- LOCAL BLOCK -->
@include('fo.partials.local-block')
<x-local-block-component />
@endsection