File: /home/lenf4658/public_html/unukaltim.lensapedia.id/unukaltim/app/View/Components/Web/NavItem.php
<?php
namespace App\View\Components\Web;
use App\Models\WebPage;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class NavItem extends Component
{
/**
* Create a new component instance.
*/
public function __construct()
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$data['akademiks'] = WebPage::where('type', 'akademik')->orderBy('name')->get();
$data['lembagas'] = WebPage::where('type', 'lembaga')->orderBy('name')->get();
$data['layanans'] = WebPage::where('type', 'layanan')->orderBy('name')->get();
return view('components.web.nav-item', $data);
}
}