Skip to content

Commit

Permalink
Only allow asc or desc to be passed into orderBy.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 15, 2013
1 parent bf4ddbd commit 2aaa601
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,8 @@ public function orHavingRaw($sql, array $bindings = array())
*/
public function orderBy($column, $direction = 'asc')
{
$direction = strtolower($direction) == 'asc' ? 'asc' : 'desc';

$this->orders[] = compact('column', 'direction');

return $this;
Expand Down

0 comments on commit 2aaa601

Please sign in to comment.