Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function getMigrations($steps)
{
$query = $this->table()->where('batch', '>=', '1');

return $query->orderBy('batch', 'desc')
->orderBy('migration', 'desc')
return $query->orderByDesc('batch')
->orderByDesc('migration')
->limit($steps)
->get()
->all();
Expand All @@ -79,7 +79,7 @@ public function getMigrationsByBatch($batch)
{
return $this->table()
->where('batch', $batch)
->orderBy('migration', 'desc')
->orderByDesc('migration')
->get()
->all();
}
Expand All @@ -93,7 +93,7 @@ public function getLast()
{
$query = $this->table()->where('batch', $this->getLastBatchNumber());

return $query->orderBy('migration', 'desc')->get()->all();
return $query->orderByDesc('migration')->get()->all();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2723,7 +2723,7 @@ public function orderByDesc($column)
*/
public function latest($column = 'created_at')
{
return $this->orderBy($column, 'desc');
return $this->orderByDesc($column);
}

/**
Expand Down Expand Up @@ -2866,7 +2866,7 @@ public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id')
$this->where($column, '<', $lastId);
}

return $this->orderBy($column, 'desc')
return $this->orderByDesc($column)
->limit($perPage);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function ids($queue = null)
{
return $this->getTable()
->when(! is_null($queue), fn ($query) => $query->where('queue', $queue))
->orderBy('id', 'desc')
->orderByDesc('id')
->pluck('id')
->all();
}
Expand All @@ -85,7 +85,7 @@ public function ids($queue = null)
*/
public function all()
{
return $this->getTable()->orderBy('id', 'desc')->get()->all();
return $this->getTable()->orderByDesc('id')->get()->all();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Failed/DatabaseUuidFailedJobProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function ids($queue = null)
{
return $this->getTable()
->when(! is_null($queue), fn ($query) => $query->where('queue', $queue))
->orderBy('id', 'desc')
->orderByDesc('id')
->pluck('uuid')
->all();
}
Expand All @@ -88,7 +88,7 @@ public function ids($queue = null)
*/
public function all()
{
return $this->getTable()->orderBy('id', 'desc')->get()->map(function ($record) {
return $this->getTable()->orderByDesc('id')->get()->map(function ($record) {
$record->id = $record->uuid;
unset($record->uuid);

Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseMigrationRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testGetLastMigrationsGetsAllMigrationsWithTheLatestBatchNumber()
$repo->getConnectionResolver()->shouldReceive('connection')->with(null)->andReturn($connectionMock);
$repo->getConnection()->shouldReceive('table')->once()->with('migrations')->andReturn($query);
$query->shouldReceive('where')->once()->with('batch', 1)->andReturn($query);
$query->shouldReceive('orderBy')->once()->with('migration', 'desc')->andReturn($query);
$query->shouldReceive('orderByDesc')->once()->with('migration')->andReturn($query);
$query->shouldReceive('get')->once()->andReturn(new Collection(['foo']));
$query->shouldReceive('useWritePdo')->once()->andReturn($query);

Expand Down