Permalink
Browse files

Added wherePivot to belongsToMany.

  • Loading branch information...
taylorotwell committed Nov 25, 2013
1 parent ddfacfb commit 5d485777847b5641101af68660b925e2cab30ec3
@@ -73,6 +73,34 @@ public function getResults()
return $this->get();
}
/**
* Set a where clause for a pivot table column.
*
* @param string $column
* @param string $operator
* @param mixed $value
* @param string $boolean
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function wherePivot($column, $operator = null, $value = null, $boolean = 'and')
{
return $this->where($this->table.'.'.$column, $operator, $value, $boolean);
}
/**
* Set an or where clause for a pivot table column.
*
* @param string $column
* @param string $operator
* @param mixed $value
* @param string $boolean
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function orWherePivot($column, $operator = null, $value = null)
{
return $this->wherePivot($column, $operator, $value, 'or');
}
/**
* Execute the query and get the first result.
*
@@ -57,7 +57,8 @@
{"message": "New 'Password::validator' function that allows custom validation on passwords when resetting.", "backport": null},
{"message": "Added support for checking job attempts to Iron.io queue jobs.", "backport": null},
{"message": "Added support for releasing pushed Iron.io jobs back onto the queue.", "backport": null},
{"message": "Allow strict mode option to be enabled for MySQL connections.", "backport": null}
{"message": "Allow strict mode option to be enabled for MySQL connections.", "backport": null},
{"message": "Added 'wherePivot' and 'orWherePivot' methods to BelongsToMany relationship for convenience.", "backport": null}
],
"4.0.x": [
{"message": "Added implode method to query builder and Collection class.", "backport": null},

0 comments on commit 5d48577

Please sign in to comment.