title: Method Illuminate\Database\Eloquent\Collection::links does not exist
body: <p>I created a model relationship between User and Message. I want to implement a list of messages for the authenticated user but I get the following error.</p>
  
  <blockquote>
    <p>Method Illuminate\Database\Eloquent\Collection::links does not exist</p>
  </blockquote>
  
  <p><strong>Controller</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>public function index()
  {
      $user_id = auth()-&gt;user()-&gt;id;
      $user = User::find($user_id);
      return view('message.index')-&gt;with('messages', $user-&gt;message);
  }
  </code></pre>
  
  <p><strong>Message provider</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>class message extends Model
  {
      public function user() {
          return $this-&gt;belongsTo('App\User');
      }
  }
  </code></pre>
  
  <p><strong>User provider</strong> </p>
  
  <pre class="lang-php prettyprint-override"><code>public function message ()
  {
      return $this-&gt;hasMany('App\Message');
  }
  </code></pre>
  
  <p><strong>index.blade.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>@extends('layouts.app')
  @section('content')
      &lt;h1&gt;messages&lt;/h1&gt;
      @if(count($messages)&gt;0)
          @foreach ($messages as $message)
              &lt;div class="well"&gt;
                  &lt;h3&gt;&lt;a href="/message/{{$message-&gt;id}}"&gt;{{$message-&gt;user}}&lt;/a&gt;&lt;/h3&gt;
                  &lt;small&gt;Written on {{$message-&gt;created_at}} &lt;/small&gt;
              &lt;/div&gt;
          @endforeach
          {{$messages-&gt;links()}}
      @else
          &lt;p&gt; no post found &lt;/p&gt;
      @endif
  @endsection
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>"Method Illuminate\Database\Eloquent\Collection::links does not exist.(View: C:\xampp\htdocs\basicwebsite\resources\views\message\index.blade.php)"</p>
  </blockquote>