Skip to content

Commit

Permalink
Document where clause on joins.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 11, 2013
1 parent e747c7a commit 05ba97f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ You may also specify more advanced join clauses:
})
->get();

If you would like to use a "where" style clause on your joins, you may use the `where` and `orWhere` methods on a join. Instead of comparing two columns, these methods will compare the column against a value:

DB::table('users')
->join('contacts', function($join)
{
$join->on('users.id', '=', 'contacts.user_id')
->where('contacts.user_id', '>', 5);
})
->get();

<a name="advanced-wheres"></a>
## Advanced Wheres

Expand Down

0 comments on commit 05ba97f

Please sign in to comment.