ldc-legaulois/app/View/Components/Fo/Story/HistoricalMilestoneComponent.php
2024-10-08 12:22:52 +02:00

39 lines
1.1 KiB
PHP

<?php
namespace App\View\Components\Fo\Story;
use Illuminate\View\Component;
use App\Models\StaticPage;
use App\Enums\StaticPageType;
use App\Models\HistoricalMilestone;
class HistoricalMilestoneComponent extends Component
{
/** @var \App\Models\StaticPage $staticPageModel */
public $staticPageModel;
/** @var \Illuminate\Database\Eloquent\Collection $historicalMilestoneModels */
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.
*
* @return \Illuminate\Contracts\View\View
*/
public function render(): \Illuminate\Contracts\View\View
{
return view('components.fo.story.historical-milestone-component', [
'staticPageModel' => $this->staticPageModel,
'historicalMilestoneModels' => $this->historicalMilestoneModels
]);
}
}