You seem to know all that is needed
Just use if to render your admin menu
@if(Auth::user()->is_admin)
<li class="nav-item">
<a class="nav-link" href="/Admin">Admin</a>
</li>
@endif
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to display a different navigation bar for the Admin user. I've added an 'is_admin' attribute to my user model. It's a boolean value, if 'is_admin' = 1, the user is an admin. Here's the model
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password', 'is_admin',
];
Here's the current nav bar
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
<li class="nav-item">
<a class="nav-link" href="/timetracker">Time</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/reports/create">Reports</a>
</li>
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
I want it so the regular user will have the current nav-bar items, and the is_admin user will have one nav-item called:
<li class="nav-item">
<a class="nav-link" href="/Admin">Admin</a>
</li>
How could I do this?
You seem to know all that is needed
Just use if to render your admin menu
@if(Auth::user()->is_admin)
<li class="nav-item">
<a class="nav-link" href="/Admin">Admin</a>
</li>
@endif
Please or to participate in this conversation.