title: Check if column exist in Laravel model's table and then apply condition
body: <p><strong>Current Situation</strong> : We are creating new database for new registration.</p>
  
  <p><strong>Problem</strong> : If any changes done in database migration we need to handle it for previously created database. Or run that migration for each previously created database.</p>
  
  <p>If we run migration for each database no problem. </p>
  
  <p><strong>Question</strong> : how to check database table has column for which we are applying condition in query.</p>
  
  <p>Currently I need to fire two queries first for first row and check the existence of that column and then apply condition in where clause. like below</p>
  
  <pre><code>$firstRow = Model::first();
  if(isset($firstRow-&gt;is_splited)){
      $records = Model::where('is_splited',0)-&gt;get(); // this will give error if I don't check column existence for previously created database. 
  }else{
      $records = Model::all();
  }
  </code></pre>
  
  <p>Is there any way to achieve in one query. Or any better way to do it ?</p>
  
  <hr>
  
  <p><em>Thanks for your time and suggestion.</em></p>