From 45cb9cd13a045a7d1d263200cdbba16ce53f045a Mon Sep 17 00:00:00 2001 From: Lukas Staab Date: Tue, 4 Feb 2025 15:40:42 +0100 Subject: [PATCH] phpstan-fix --- app/Console/Commands/LegacyBudgetGroupShiftCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/LegacyBudgetGroupShiftCommand.php b/app/Console/Commands/LegacyBudgetGroupShiftCommand.php index d091b755..7b09fbdb 100644 --- a/app/Console/Commands/LegacyBudgetGroupShiftCommand.php +++ b/app/Console/Commands/LegacyBudgetGroupShiftCommand.php @@ -18,7 +18,7 @@ class LegacyBudgetGroupShiftCommand extends Command public function handle(): void { \DB::transaction(function () { - $latestPlan = LegacyBudgetPlan::all()->last(); + $latestPlan = LegacyBudgetPlan::orderBy('id', 'desc')->limit(1)->first(); $budgetGroups = LegacyBudgetGroup::where('hhp_id', $latestPlan->id) ->where('id', '>=', $this->argument('new_group_id')); $this->info('The following amount of other groups will be shifted back: '.$budgetGroups->count());