title: Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in laravel 5.4 and it's not duplicated
body: <p>So, guys, this is the error I am getting in my project.</p>
  
  <p>Parse error: syntax error, unexpected end of the file, expecting function (T_FUNCTION) or const (T_CONST)
  <a href="https://i.imgur.com/i4iMnze.jpg" rel="nofollow noreferrer">https://i.imgur.com/i4iMnze.jpg</a></p>
  
  <p>code for video model:-</p>
  
  <pre><code> &lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Video extends Model
  {
  public function videos(){
      return $this-&gt;belongsTo("App\Category");
  }
  </code></pre>
  
  <p>Code for category model:-</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Category extends Model
  {
  
  }
  </code></pre>
  
  <p>Code for layouts.app:-</p>
  
  <pre><code>  &lt;!DOCTYPE html&gt;
      &lt;html lang="{{ app()-&gt;getLocale() }}"&gt;
      &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  
      &lt;!-- CSRF Token --&gt;
      &lt;meta name="csrf-token" content="{{ csrf_token() }}"&gt;
  
      &lt;title&gt;{{ config('app.name', 'Laravel') }}&lt;/title&gt;
  
      &lt;!-- Styles --&gt;
      &lt;link href="{{ asset('css/app.css') }}" rel="stylesheet"&gt;
      &lt;/head&gt;
      &lt;body&gt;
         &lt;div id="app"&gt;
         &lt;nav class="navbar navbar-default navbar-static-top"&gt;
            &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
  
                  &lt;!-- Collapsed Hamburger --&gt;
                  &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse"&gt;
                      &lt;span class="sr-only"&gt;Toggle Navigation&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;/button&gt;
  
                  &lt;!-- Branding Image --&gt;
                  &lt;a class="navbar-brand" href="{{ url('/') }}"&gt;
                      {{ config('app.name', 'Laravel') }}
                  &lt;/a&gt;
              &lt;/div&gt;
  
              &lt;div class="collapse navbar-collapse" id="app-navbar-collapse"&gt;
                  &lt;!-- Left Side Of Navbar --&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &amp;nbsp;
                  &lt;/ul&gt;
  
                  &lt;!-- Right Side Of Navbar --&gt;
                  &lt;ul class="nav navbar-nav navbar-right"&gt;
                      &lt;!-- Authentication Links --&gt;
                      @if (Auth::guest())
                          &lt;li&gt;&lt;a href="{{ route('login') }}"&gt;Login&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="{{ route('register') }}"&gt;Register&lt;/a&gt;&lt;/li&gt;
                      @else
                          &lt;li class="dropdown"&gt;
                              &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"&gt;
                                  {{ Auth::user()-&gt;name }} &lt;span class="caret"&gt;&lt;/span&gt;
                              &lt;/a&gt;
  
                              &lt;ul class="dropdown-menu" role="menu"&gt;
                                  &lt;li&gt;
                                      &lt;a href="{{ route('logout') }}"
                                          onclick="event.preventDefault();
                                                   document.getElementById('logout-form').submit();"&gt;
                                          Logout
                                      &lt;/a&gt;
  
                                      &lt;form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"&gt;
                                          {{ csrf_field() }}
                                      &lt;/form&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;
                          &lt;/li&gt;
                      @endif
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/nav&gt;
  
      @yield('content')
  &lt;/div&gt;
  
  &lt;!-- Scripts --&gt;
  &lt;script src="{{ asset('js/app.js') }}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Code for vido.blade.php</p>
  
  <pre><code>    @extends('layouts.app')
        @section('content')
  &lt;div class="col-lg-4 col-lg-offset-1"&gt;
          &lt;form id="addproduct" class="" enctype="multipart/form-data" method="post"&gt;
            &lt;input type="hidden" name="_token" value="{{csrf_token()}}"&gt;
          &lt;div class="form-group"&gt;
            &lt;label for="type"&gt;Custom Name&lt;/label&gt;
            &lt;input type="text" class="form-control" name="vid_name" id="name" placeholder="Product Name"&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
            &lt;label for="type"&gt;Video ID&lt;/label&gt;
            &lt;input type="text" class="form-control" name="vid_id" id="Quantity" placeholder="Price"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;select class="form-control category" name="category" id=""&gt;
                  &lt;option value=""&gt;--select category--&lt;/option&gt;
                  @foreach($categories as $category)
                  &lt;option value="{{$category-&gt;id}}"&gt;{{$category-&gt;category}}&lt;/option&gt;
                  @endforeach
              &lt;/select&gt;
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
        &lt;/form&gt;
  
  
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    @endsection
  </code></pre>
  
  <p>Code for videocontroller:-</p>
  
  <pre><code>public function video(){
          $categories= \App\Category::all();
  
          return view('admin.video')
          -&gt;with("categories",$categories);
      }
  
      public function addVideo(Request $request){
           $un= new \App\Video;
           $un-&gt;custom_name= $request-&gt;get('vid_name');
           $un-&gt;vid_id= $request-&gt;get('vid_id');
           $un-&gt;category= $request-&gt;get('category');
           $un-&gt;feature_status="0";
           $un-&gt;status="1";
           $un-&gt;save();
           if($un){
              return redirect()-&gt;back();
           }
      }
  </code></pre>
  
  <p>so guys I think i added all the code which is needed to know the error of my project. other thing is that when I remove category option from video form it works perfect. I don't know now that if it's error in my code or it's relationship error in models. please help......</p>
  
  <p>Thanks in advance</p>