title: Laravel - carbon addDays()
body: <p>Why is it not showing me anything on my blade when I add <code>$date-&gt;addDays(5)</code>?
  Here is my Controller:</p>
  
  <pre><code>use Carbon\Carbon;
  ...
  public function index(){
  
     $date = Carbon::now();
     $date-&gt;addDays(5);
     $date-&gt;format("Y-m-d");
     $posts = Post::where('status','=', 1)-&gt;whereDate('created_at','=', $date)-&gt;get();
     return view('home', compact('date', $date))-&gt;with('posts', $posts);
  }
  ...
  </code></pre>
  
  <p>And this is my <code>home.blade.php</code>:</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
  &lt;div class="container"&gt;
      &lt;div class="row justify-content-center"&gt;
          &lt;div class="col-md-8"&gt;
              &lt;div class="card"&gt;
                  &lt;div class="card-header"&gt;All posts
                      &lt;a href="/posts/create" class="btn btn-primary" style="margin-left: 70%"&gt;New post +&lt;/a&gt;&lt;/div&gt;
                  &lt;hr&gt;
                  &lt;div class="card-body"&gt;
                      @foreach($posts as $post)
                          @if($post-&gt;status == 1)
                              &lt;small style="color:red"&gt;PREMIUM POST&lt;/small&gt;
                              &lt;hr&gt;
                          @endif
                          &lt;h2&gt;{{$post-&gt;name}}&lt;/h2&gt;&lt;br&gt;
                          &lt;medium&gt;{{$post-&gt;body}}&lt;/medium&gt;
                          &lt;hr style="border: 1.5px solid grey"&gt;
                      @endforeach
                      &lt;small&gt;&lt;?php echo now() ?&gt;&lt;/small&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>
  
  <p>What is solution to this problem? It doesn't showing me anything in my blade after I add <code>$date-&gt;addDays(5);</code>?</p>
  
  <p>EDITED : I just need my posts to be visible for 5 days and after that not. That's all, maybe the mistake is with <code>addDays();</code> because if i delete it my blade is now showing me posts but only for today.</p>