how to add a link to the admin page in the default welcome.blade.php in laravel 8

I’ve made an isAdmin middleware to check if the user is the admin, what I’m I doing wrong? The code for welcome.blade.php

    <div class="">
        @if (Route::has('login'))
        <div class="">
            @auth
            <a href="{{ url('/home') }}" class="">Home</a>
            @isadmin
            <a href="{{ url('/admin-view') }}" class="">Admin View</a>
            @endisadmin
            @else
            <a href="{{ route('login') }}" class="">Log in</a>

            @if (Route::has('register'))
            <a href="{{ route('register') }}" class="ml-4 ">Register</a>
            @endif
            @endauth
        </div>
        @endif
    </div>

it’s just printing @isadmin instead of checking if the user is the admin.

Answer

You can check it this way

@if(Auth::user()->role === "admin")
...
@endif

Of course assuming you have an attribute role in your User model. Middlewares are used to deal with HTTP requests.