app.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!doctype html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <!-- CSRF Token -->
  7. <meta name="csrf-token" content="{{ csrf_token() }}">
  8. <title>{{ config('app.name', 'Laravel') }}</title>
  9. <!-- Scripts -->
  10. <script src="{{ asset('/js/app.js') }}" defer></script>
  11. <!-- Fonts -->
  12. <link rel="dns-prefetch" href="//fonts.gstatic.com">
  13. <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
  14. <!-- Styles -->
  15. <link href="{{ asset('/css/app.css') }}" rel="stylesheet">
  16. </head>
  17. <body>
  18. <div id="app">
  19. <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
  20. <div class="container">
  21. <a class="navbar-brand" href="{{ url('/') }}">
  22. {{ config('app.name', 'Laravel') }}
  23. </a>
  24. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
  25. <span class="navbar-toggler-icon"></span>
  26. </button>
  27. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  28. <!-- Left Side Of Navbar -->
  29. <ul class="navbar-nav me-auto">
  30. @auth
  31. @if (Auth::user()->hasRole('Administrator'))
  32. <li class="nav-item dropdown">
  33. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
  34. Books
  35. </a>
  36. <div class="dropdown-menu">
  37. <a class="dropdown-item" href="{{ route('books.index') }}">List all</a>
  38. <a class="dropdown-item" href="{{ route('books.create')}}">Create new</a>
  39. </div>
  40. </li>
  41. <li class="nav-item dropdown">
  42. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
  43. Categories
  44. </a>
  45. <div class="dropdown-menu">
  46. <a class="dropdown-item" href="{{ route('categories.index') }}">List all</a>
  47. <a class="dropdown-item" href="{{ route('categories.create') }}">Create new</a>
  48. </div>
  49. </li>
  50. <li class="nav-item dropdown">
  51. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
  52. Loans
  53. </a>
  54. <div class="dropdown-menu">
  55. <a class="dropdown-item" href="{{ route('loans.index') }}">List all</a>
  56. <a class="dropdown-item" href="{{ route('loans.create') }}">Create new</a>
  57. </div>
  58. </li>
  59. <li class="nav-item dropdown">
  60. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
  61. Penalties
  62. </a>
  63. <div class="dropdown-menu">
  64. <a class="dropdown-item" href="{{ route('penalties.index') }}">List all</a>
  65. <a class="dropdown-item" href="{{ route('penalties.create') }}">Create new</a>
  66. </div>
  67. </li>
  68. <li class="nav-item dropdown">
  69. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
  70. Users
  71. </a>
  72. <div class="dropdown-menu">
  73. <a class="dropdown-item" href="{{ route('users.index') }}">List all</a>
  74. <a class="dropdown-item" href="{{ route('users.create') }}">Create new</a>
  75. </div>
  76. </li>
  77. @else
  78. <li class="nav-item">
  79. <a href="{{ route('books.index') }}" class="nav-link">Books</a>
  80. </li>
  81. <li class="nav-item">
  82. <a href="{{ route('categories.index') }}" class="nav-link">Categories</a>
  83. </li>
  84. <li class="nav-item">
  85. <a href="{{ route('loans.index') }}" class="nav-link">Loans</a>
  86. </li>
  87. <li class="nav-item">
  88. <a href="{{ route('penalties.index') }}" class="nav-link">Penalties</a>
  89. </li>
  90. @endif
  91. @else
  92. <li class="nav-item">
  93. <a href="{{ route('books.index') }}" class="nav-link">Books</a>
  94. </li>
  95. <li class="nav-item">
  96. <a href="{{ route('categories.index') }}" class="nav-link">Categories</a>
  97. </li>
  98. @endauth
  99. </ul>
  100. <!-- Right Side Of Navbar -->
  101. <ul class="navbar-nav ms-auto">
  102. <!-- Authentication Links -->
  103. @guest
  104. @if (Route::has('login'))
  105. <li class="nav-item">
  106. <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
  107. </li>
  108. @endif
  109. @if (Route::has('register'))
  110. <li class="nav-item">
  111. <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
  112. </li>
  113. @endif
  114. @else
  115. <li class="nav-item dropdown">
  116. <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
  117. <img src="{{ Auth::user()->image }}" class="me-1 rounded-circle" alt="{{ Auth::user()->name }}" width="32" height="32"/>
  118. <span class="align-middle">{{ Auth::user()->name }}</span>
  119. </a>
  120. <div class="dropdown-menu dropdown-menu-end">
  121. <a class="dropdown-item" href="{{ route('profiles.show', Auth::user()->id) }}">Profile</a>
  122. <a class="dropdown-item" href="{{ route('logout') }}"
  123. onclick="event.preventDefault();document.getElementById('logout-form').submit();">
  124. {{ __('Logout') }}
  125. </a>
  126. <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
  127. @csrf
  128. </form>
  129. </div>
  130. </li>
  131. @endguest
  132. </ul>
  133. </div>
  134. </div>
  135. </nav>
  136. <main class="py-4 text-break">
  137. @yield('content')
  138. </main>
  139. </div>
  140. </body>
  141. </html>