diff --git a/src/Controllers/ShowQueueMonitorController.php b/src/Controllers/ShowQueueMonitorController.php index 57e3c42..4c4a071 100644 --- a/src/Controllers/ShowQueueMonitorController.php +++ b/src/Controllers/ShowQueueMonitorController.php @@ -54,9 +54,8 @@ public function __invoke(Request $request) $jobsQuery->where('data', 'like', "%{$filters['custom_data']}%"); } + $connection = DB::connection(); if (config('queue-monitor.ui.order_queued_first')) { - $connection = DB::connection(); - if ($connection instanceof DatabaseConnections\MySqlConnection) { $jobsQuery->orderByRaw('-`started_at`'); } @@ -68,6 +67,8 @@ public function __invoke(Request $request) if ($connection instanceof DatabaseConnections\SQLiteConnection) { $jobsQuery->orderByRaw('started_at DESC NULLS FIRST'); } + } elseif ($connection instanceof DatabaseConnections\PostgresConnection) { + $jobsQuery->orderByRaw('started_at DESC NULLS LAST'); } $jobsQuery