ldc-legaulois/app/View/Components/Fo/Story/HistoricalMilestoneComponent.php
2024-09-26 09:54:58 +02:00

35 lines
1,003 B
PHP

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