title: Filter a laravel collection inside a view by comparing dates?
body: <p>I am trying to filter a collection of objects by comparing date its expiry date with today's date but I cant quite get it to work. Can anyone take a look at the code. I'm sure i'm missing something here. I have searched all over and found alot of examples but none are working.</p>
  
  <p>This complies just fine but with a list of 9 objects 3 of which have an expiry date which is set to 2012 it doesn't return any results from the collection.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function classifieds()
  {   
      $myclassifieds = Auth::user()-&gt;classifieds;
      return view('account.classifieds')-&gt;with(['allclassifieds'=&gt;$myclassifieds]);
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>@if(count($allclassifieds-&gt;where('expired_on','&lt;', Carbon\Carbon::now() ) ) &gt; 0)
  //Something here
  @endif
  </code></pre>