title: count(): Parameter must be an array or an object that implements Countable
body: <p>I'm facing strange case. I face an error in production env not while in dev it's working fine. </p>
  
  <p>Development:
  Laravel 5.4.28
  PHP 7.0.13
  MYSQL 5.7.17</p>
  
  <p>Production:
  Laravel 5.4.28
  PHP 7.2.1
  MYSQL 5.7.20</p>
  
  <p>In implementation code. I used:</p>
  
  <pre><code>namespace App;
  use Illuminate\Support\Facades\Storage;
  use Laravel\Scout\Searchable;
  use Illuminate\Database\Eloquent\Model;
  
  class Artwork extends Model
  {
    use Searchable;
  </code></pre>
  
  <p>In development it works fine. But in production it gives me this error:
  count(): Parameter must be an array or an object that implements Countable
  in Builder.php (line 936)</p>
  
  <p>as you can see in this pic:</p>
  
  <p><a href="https://i.stack.imgur.com/85rR1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/85rR1.png" alt="enter image description here"></a></p>
  
  <p>Any idea what is the reason behind this? and how to fix?</p>