diff --git a/app/Console/Commands/FixMismatchedAssetsAndLogs.php b/app/Console/Commands/FixMismatchedAssetsAndLogs.php index 526cb8a8a8..45a1694dd7 100644 --- a/app/Console/Commands/FixMismatchedAssetsAndLogs.php +++ b/app/Console/Commands/FixMismatchedAssetsAndLogs.php @@ -57,7 +57,9 @@ class FixMismatchedAssetsAndLogs extends Command } $mismatch_count = 0; - $assets = Asset::whereNotNull('assigned_to')->where('assigned_type', '=', 'App\\Models\\User')->get(); + $assets = Asset::whereNotNull('assigned_to') + ->where('assigned_type', '=', 'App\\Models\\User') + ->orderBy('id', 'ASC')->get(); foreach ($assets as $asset) { // get the last checkout of the asset