title: Laravel database request
body: <p>I have an original request that I made in the Navicat program:</p>
  
  <pre><code>SELECT
  tt1.team AS team1,
  tt2.team AS team2,
  tt1.logo AS team1_logo,
  tt2.logo AS team2_logo,
  tt1.id AS team1_id,
  tt2.id AS `team2_id,`,
  tournaments_matches.`status`,
  tournaments_matches.started_at,
  tt1.x AS x1,
  tt2.x AS x2,
  tournaments_matches.live,
  tournaments_matches.winner_id
  FROM
  tournaments_teams AS tt1
  INNER JOIN tournaments_teams AS tt2 ON tt1.match_id = tt2.match_id AND tt1.id != tt2.id
  INNER JOIN tournaments_matches ON tournaments_matches.match_id = tt2.match_id AND tournaments_matches.match_id = tt1.match_id
  GROUP BY
  tt1.match_id
  </code></pre>
  
  <p>I tried to remake this query in Laravel Query Builder, I got this:</p>
  
  <pre><code>    $opponents = DB::select('tt1.team as team1','tt2.team as team2','tt1.logo as team1_logo','tt2.logo as team2_logo','tt1.id as team1_id','tt2.id as team2_id,','tournaments_matches.status','tournaments_matches.started_at','tt1.x as x1','tt2.x as x2','tournaments_matches.live','tournaments_matches.winner_id')
      -&gt;from('tournaments_teams as tt1')
      -&gt;join('tournaments_teams as tt2', function($join) {
          $join-&gt;on('tt1.match_id', '=', 'tt2.match_id')
              -&gt;on('tt1.id', '!=', 'tt2.id');
          })
      -&gt;join('tournaments_matches', function($join) {
          $join-&gt;on('tournaments_matches.match_id', '=', 'tt2.match_id')
              -&gt;on('tournaments_matches.match_id', '=', 'tt1.match_id');
          })
      -&gt;groupBy('tt1.match_id')
      -&gt;get();
  
      var_dump($opponents); exit;
  </code></pre>
  
  <p><code>tournaments_teams</code> and <code>tournaments_matches</code> it's a different tables in the database.</p>
  
  <p>But when i try to access page, <code>var_dump</code> say me error <code>Type error: Argument 1 passed to Illuminate\Database\Connection::prepareBindings() must be of the type array, string given, called in</code>. Where is the problem? How i can fix this? </p>