title: How to limit the number of notifications in Laravel
body: <p>I have tried the <code>-&gt;limit(4)</code> methods, but that doesn't seem to work</p>
  
  <pre><code>@foreach(auth()-&gt;user()-&gt;unreadNotifications()-&gt;limit(4) as $notification)
      &lt;li&gt;
          &lt;a href="profile.html"&gt;
             &lt;div&gt;
                {{ $notification-&gt;data['message'] }}&lt;span class="pull-right text-muted small"&gt;{{ time_elapsed_string($notification-&gt;created_at) }}&lt;/span&gt;
             &lt;/div&gt;
          &lt;/a&gt;
      &lt;/li&gt;
  @endforeach
  </code></pre>