Files
portal-api/app/View/Composers/MenuComposer.php
T
2025-07-24 16:18:27 +07:00

21 lines
520 B
PHP

<?php
namespace App\View\Composers;
use App\Repositories\Menu\MenuRepositoryInterface;
use Illuminate\View\View;
class MenuComposer
{
protected MenuRepositoryInterface $menuRepositoryInterface;
public function __construct(MenuRepositoryInterface $menuRepositoryInterface)
{
$this->menuRepositoryInterface = $menuRepositoryInterface;
}
public function compose(View $view): void
{
$menus = $this->menuRepositoryInterface->getTree();
$view->with('menus', $menus);
}
}