title: Laravel 8 query builder filter results by two datetime columns with whereDate
body: <p>I'm using Laravel 8's query builder to return a particular result from my database. I've got my query partially working with most of what I need but am having some issues trying to filter based on two particular <code>datetime</code> columns.</p>
  <p>I've got two columns: <code>period_from</code> and <code>period_to</code>, I'd like to be able to return the relevant results <strong>after</strong> a given date on the <code>period_from</code> column, but before the <code>period_to</code> column with a different date, this is what I've got so far:</p>
  <pre class="lang-php prettyprint-override"><code>$events = GoogleAnalytics::where('event_category', $category)
                          -&gt;where('event_action', $action)
                          -&gt;whereDate('period_from', $dateFrom)
                          -&gt;whereDate('period_to', $dateTo)
                          -&gt;orderBy('created_at', 'desc')
                          -&gt;first();
  </code></pre>
  <p>This unfortunately doesn't work, I can get results if I drop the <code>period_to</code> column, but I need to filter between the two dates. Why isn't this working? Can I have some guidance please? :)</p>