title: Laravel - Union + Paginate at the same time?
body: <p><strong>Brief:</strong></p>
  
  <p>I am trying to union 2 tables <code>recipes</code> and <code>posts</code> then add <code>-&gt;paginate(5)</code> to the queries.</p>
  
  <p>But for some reason I get this error:</p>
  
  <blockquote>
    <p>Cardinality violation: 1222 The used SELECT statements have a
    different number of columns (SQL: (select count(*) as aggregate from
    <code>posts</code></p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>$recipes = DB::table("recipes")-&gt;select("id", "title", "user_id", "description", "created_at")
                      -&gt;where("user_id", "=", $id);
  
  $items = DB::table("posts")-&gt;select("id", "title", "user_id", "content", "created_at")
                  -&gt;where("user_id", "=", $id)
                  -&gt;union($recipes)
                  -&gt;paginate(5)-&gt;get();
  </code></pre>
  
  <p>Am i doing something wrong?</p>
  
  <p>Without <code>-&gt;paginate(5)</code> the query works fine.</p>