ldc-legaulois/app/View/Components/Fo/Story/HistoricalMilestoneComponent.php
2026-09-25 16:25:31 +02:00

38 lines
1.1 KiB
PHP

<?php
namespace App\View\Components\Fo\Story;
use App\Enums\StaticPageType;
use App\Models\HistoricalMilestone;
use App\Models\StaticPage;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class HistoricalMilestoneComponent extends Component
{
/** @var \App\Models\StaticPage */
public $staticPageModel;
/** @var \Illuminate\Database\Eloquent\Collection */
public $historicalMilestoneModels;
/**
* Create a new component instance.
*/
public function __construct()
{
$this->staticPageModel = StaticPage::getCachedStaticPage(StaticPageType::story);
$this->historicalMilestoneModels = HistoricalMilestone::getPublishedOrdered();
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View
{
return view('components.fo.story.historical-milestone-component', [
'staticPageModel' => $this->staticPageModel,
'historicalMilestoneModels' => $this->historicalMilestoneModels,
]);
}
}