Trying to fix syntax error, unexpected end of file on template.blade

  laravel, php, syntax

I’ve been `getting syntax error, unexpected end of file (View: C:xampphtdocsnerdSresourcesviewstemplate.blade.php) for a while now, which sadly is stopping me from debugging other pages in my project. I can’t seem to find any issues, and I’m still pretty new to Laravel, so I was hoping for a nudge in the right direction!

Here’s the template.blade:

<!DOCTYPE html>
<html lang="{{str_replace('_', '-', app()->getLocale())}}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title> Cool Nerd Club </title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
        <link rel="stylesheet" href="{{asset('css/style.css')}}">
    </head>
    <body class="antialiased">
        <header class="mb-5">
            <nav class="navbar navbar-expand-lg navbar-light bg-light">
                <div class="container">
                    <a class="navbar-brand" href="{{url('/')}}"><img class="nav-logo" src="{{asset('images/logo.png')}}"></a>
                  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav mr-auto">
                      <li class="nav-item active">
                        <a class="nav-link" href="{{url('/')}}">Home <span class="sr-only">(current)</span></a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link" href="{{url('about')}}">About</a>
                      </li>
                      @unless(! $pages->isEmpty)
                      <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                          News
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                          @foreach($pages as $page)
                          <a class="dropdown-item" href="{{url('$page->slug')}}">{{$page->name}}</a>
                          @endforeach
                        </div>
                      </li>
                      @endunless
                      <li class="nav-item">
                        <a class="nav-link" href="{{url('shop')}}">Shop</a>
                      </li>
                    </ul>
                      <ul class="navbar-nav mr-auto">
                          @if(session('id'))
                          @if(session('role')===42)
                          <li>
                              <a class="nav-link font-weight-bold" href="{{url('admin')}}">{{session('name')}} Admin Dashboard︎︎ </a>
                          </li>
                          @endif
                          <li>
                              <a class="nav-link" href="{{url('logout')}}">{{session('name')}} Logout</a>
                          </li>
                          @else
                          <li>
                              <a class="nav-link" href="{{url('signup')}}"> Sign Up </a>
                          </li>
                          <li>
                              <a class="nav-link" href="{{url('login')}}"> Login</a>
                          </li>
                          @endelse
                      </ul>
                      <div id="mini-cart">
                          <a href="{{url('cart')}}"></a>
                          <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-basket3" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                          <path fill-rule="evenodd" d="M5.757 1.071a.5.5 0 0 1 .172.686L3.383 6h9.234L10.07 1.757a.5.5 0 1 1 .858-.514L13.783 6H15.5a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 6h1.717L5.07 1.243a.5.5 0 0 1 .686-.172zM3.394 15l-1.48-6h-.97l1.525 6.426a.75.75 0 0 0 .729.574h9.606a.75.75 0 0 0 .73-.574L15.056 9h-.972l-1.479 6h-9.21z"/>
                          </svg>
                          <span>{{$cart_count?:''}}</span>
                      </div>
                  </div>
                </div>
            </nav>
        </header>
        <main>
            <div class="container">
                <div id="alert">
                @if (session('status'))
                <div class="alert alert-success">
                    {!! session('status') !!}
                </div>
                @endif
                @if (session('status-fail'))
                <div class="alert alert-danger">
                    {{session('status-fail')}}
                </div>
                @endif
                @if ($errors->any())
                </div>
                <div class="alert alert-danger">
                    <ul>
                @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                @endforeach
                    </ul>
                </div>
                @endif
               @yield('content')
            </div>
        </main>
        <footer>
            <div class="container text-center p-5">
               @Developed by Shira Stein {{date('Y')}}
            </div>
        </footer>
    <script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
    <script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>  
    <script src="{{asset('js/jquery-3.5.1.min.js')}}"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
    <script src="{{asset('js/script.js')}}"></script>
    </body>
</html>

Thank you for any help!

Source: Laravel

Leave a Reply