# Navigation Component

resources / views / components / nav.blade.php

# Code Overview

<div class="row bg-white shadow-sm justify-content-center navbar-menu-container">
    <div class="col-12 col-md-10">
        <div class="d-flex justify-content-between align-items-center py-3">
            @if(request()->is('/'))
            <a href="" id="sidebarCollapse" class="text-light badge bg-primary">
                <h4 class="mb-0">
                    <i class="fa-solid fa-bars"></i>
                </h4>
            </a>
            @else
                <a href="" id="back-btn" class="text-light badge bg-primary">
                    <h4 class="mb-0">
                        <i class="fa-solid fa-angles-left"></i>
                    </h4>
                </a>
            @endif
            <h4 class="fw-bold mb-0">@yield('page-title')</h4>
                {{--User DropDown--}}
                <a id="navbarDropdown" class="nav-link dropdown-toggle text-black fw-bold"
                   href="" role="button" data-bs-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false" v-pre>
                    <img src="{{ Auth::user()->profileImagePath() }}" alt="" class="profile-image-nav me-1">
                    {{ Auth::user()->name }}
                </a>

                <div class="dropdown-menu dropdown-menu-end mt-3" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" href="{{ route('employee.create') }}">
                        New Employee
                    </a>
                    <a class="dropdown-item" href="{{ route('department.create') }}">
                        New Department
                    </a>
                    <hr class="dropdown-divider">
                    <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" class="d-none">
                        @csrf
                    </form>
                </div>
        </div>
    </div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Last Updated: 6/1/2022, 12:13:18 AM