Files
ntspi-app/app/Containers/Main/Actions/GetMainPageDataAction.php
T
2026-03-20 21:47:02 +05:00

35 lines
1.0 KiB
PHP
Executable File

<?php
namespace App\Containers\Main\Actions;
use App\Containers\Main\Tasks\GetEducationsDataTask;
use App\Containers\Main\Tasks\GetRecentPostsTask;
use App\Containers\Main\Tasks\GetUpcomingEventsTask;
use App\Containers\Main\Tasks\GetPageDataTask;
class GetMainPageDataAction
{
public function __construct(
private readonly GetEducationsDataTask $getEducationsDataTask,
private readonly GetRecentPostsTask $getRecentPostsTask,
private readonly GetUpcomingEventsTask $getUpcomingEventsTask,
private readonly GetPageDataTask $getPageDataTask,
) {}
public function run(): array
{
$educations = $this->getEducationsDataTask->run();
$posts = $this->getRecentPostsTask->run();
$events = $this->getUpcomingEventsTask->run();
$page = $this->getPageDataTask->run();
$seo = $page->seo ?? null;
return [
'educations' => $educations,
'posts' => $posts,
'events' => $events,
'seo' => $seo
];
}
}