Skip to content

Commit

Permalink
revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 3, 2021
1 parent ecbc462 commit dc2f0bb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
10 changes: 0 additions & 10 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1983,16 +1983,6 @@ public function orderBy($column, $direction = 'asc')
throw new InvalidArgumentException('Order direction must be "asc" or "desc".');
}

if (is_array($this->{$this->unions ? 'unionOrders' : 'orders'})) {
foreach ($this->{$this->unions ? 'unionOrders' : 'orders'} as $key => $value) {
if ($value['column'] === $column) {
$this->{$this->unions ? 'unionOrders' : 'orders'}[$key]['direction'] = $direction;

return $this;
}
}
}

$this->{$this->unions ? 'unionOrders' : 'orders'}[] = [
'column' => $column,
'direction' => $direction,
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '8.45.0';
const VERSION = '8.45.1';

/**
* The base path for the Laravel installation.
Expand Down
7 changes: 0 additions & 7 deletions tests/Database/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1188,13 +1188,6 @@ public function testOrderBys()
->orderByRaw('field(category, ?, ?) asc', ['news', 'opinion']);
$this->assertSame('(select * from "posts" where "public" = ?) union all (select * from "videos" where "public" = ?) order by field(category, ?, ?) asc', $builder->toSql());
$this->assertEquals([1, 1, 'news', 'opinion'], $builder->getBindings());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->orderBy('name', 'asc');
$builder->orderBy('name', 'desc');
$builder->orderBy('email', 'desc');
$builder->orderBy('email', 'asc');
$this->assertSame('select * from "users" order by "name" desc, "email" asc', $builder->toSql());
}

public function testReorder()
Expand Down

0 comments on commit dc2f0bb

Please sign in to comment.