app.blade.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="{{ config('app.locale') }}">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- CSRF Token -->
  8. <meta name="csrf-token" content="{{ csrf_token() }}">
  9. <title>{{ config('app.name', 'Laravel') }}</title>
  10. <!-- Styles -->
  11. <link href="{{ asset('css/app.css') }}" rel="stylesheet">
  12. {{-- 插件样式引入 --}}
  13. @yield('plug-css')
  14. <script>
  15. window.Laravel = <?php echo json_encode([
  16. 'csrfToken' => csrf_token(),
  17. ]); ?>
  18. </script>
  19. </head>
  20. <body>
  21. <div id="app">
  22. <nav class="navbar navbar-default navbar-static-top">
  23. <div class="container">
  24. <div class="navbar-header">
  25. <!-- Collapsed Hamburger -->
  26. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
  27. <span class="sr-only">Toggle Navigation</span>
  28. <span class="icon-bar"></span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. </button>
  32. <!-- Branding Image -->
  33. <a class="navbar-brand" href="{{ url('/') }}">
  34. {{ config('app.name', 'Laravel') }}
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="app-navbar-collapse">
  38. <!-- Left Side Of Navbar -->
  39. <ul class="nav navbar-nav">
  40. &nbsp;
  41. </ul>
  42. <!-- Right Side Of Navbar -->
  43. <ul class="nav navbar-nav navbar-right">
  44. <!-- Authentication Links -->
  45. @if (Auth::guest())
  46. <li><a href="{{ route('login') }}">Login</a></li>
  47. <li><a href="{{ route('register') }}">Register</a></li>
  48. @else
  49. <li class="dropdown">
  50. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
  51. {{ Auth::user()->name }} <span class="caret"></span>
  52. </a>
  53. <ul class="dropdown-menu" role="menu">
  54. <li>
  55. <a href="{{ route('logout') }}"
  56. onclick="event.preventDefault();
  57. document.getElementById('logout-form').submit();">
  58. Logout
  59. </a>
  60. <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
  61. {{ csrf_field() }}
  62. </form>
  63. </li>
  64. </ul>
  65. </li>
  66. @endif
  67. </ul>
  68. </div>
  69. </div>
  70. </nav>
  71. @yield('content')
  72. </div>
  73. <!-- Scripts -->
  74. <script src="{{ asset('js/app.js').'?t=sadsadhjdsfhjdsfhj' }}"></script>
  75. {{-- 插件js引入 --}}
  76. @yield('plug-js')
  77. {{-- js代码引入 --}}
  78. @section('script')
  79. {{-- js 代码 --}}
  80. @endsection
  81. </body>
  82. </html>