40 lines
944 B
PHP
40 lines
944 B
PHP
<?php
|
|
|
|
namespace App\View\Components;
|
|
|
|
use App\Repositories\Menu\MenuRepositoryInterface;
|
|
use App\Traits\GetConfig;
|
|
use Closure;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\View\Component;
|
|
|
|
class SiderbarUser extends Component
|
|
{
|
|
use GetConfig;
|
|
|
|
public $menu;
|
|
/**
|
|
* Create a new component instance.
|
|
*/
|
|
protected MenuRepositoryInterface $menuRepositoryInterface;
|
|
|
|
public function __construct(MenuRepositoryInterface $menuRepositoryInterface)
|
|
{
|
|
$this->menuRepositoryInterface = $menuRepositoryInterface;
|
|
$this->menu = $this->menuRepositoryInterface->getTree();
|
|
}
|
|
|
|
// public function routeName($routeName, $param)
|
|
// {
|
|
// return $routeName ? route($routeName, $param) : '#';
|
|
// }
|
|
|
|
/**
|
|
* Get the view / contents that represent the component.
|
|
*/
|
|
public function render(): View|Closure|string
|
|
{
|
|
return view('components.siderbar-user');
|
|
}
|
|
}
|