public static function linkForUserProfile() { $first_name = Auth::user()->first_name; $last_name = Auth::user()->last_name; $link_admin = ''; $user = User::find(Auth::user()->getAuthIdentifier()); foreach ($user->roles as $role) { if ($role->role == "admin") { $link_admin = '<li class="' . LinksInMenu::isActive(URL::route('admin')) . '"> <a href ="' . URL::route('admin') . '">Админ панель</a> </li>'; } } $link_user = '******' . LinksInMenu::isActive(URL::route('profile')) . '"> <a href="' . URL::route('profile') . '">' . $first_name . ' ' . $last_name . '</a> </li>'; $link_logout = '<li><a href="/logout">Выход</a></li>'; return $link_admin . $link_user . $link_logout; }
<nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">fintech fab</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li <?php echo LinksInMenu::isActive(URL::route('vanguard')); ?> > <a href="<?php echo URL::route('vanguard'); ?> ">Стажировка</a> </li> <?php echo LinksInMenu::linkForMainMenu(); ?> </ul> <ul class="nav navbar-nav navbar-right"> <?php echo LinksInMenu::echoAuthMode(); ?>