Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,17 @@ public function orderByPivot($column, $direction = 'asc')
return $this->orderBy($this->qualifyPivotColumn($column), $direction);
}

/**
* Add an "order by desc" clause for a pivot table column.
*
* @param string|\Illuminate\Contracts\Database\Query\Expression $column
* @return $this
*/
public function orderByPivotDesc($column)
{
return $this->orderBy($this->qualifyPivotColumn($column), 'desc');
}

/**
* Find a related model by its primary key or return a new instance of the related model.
*
Expand Down
Loading