Normalize labor category sort_order + fix increment step to 10

Migration renumbers all categories per company as 10, 20, 30… to
eliminate existing duplicates. Observer now increments by 10 instead
of 1 to leave headroom between positions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 06:53:10 +00:00
parent 04cab25ac5
commit 2e082d4aad
2 changed files with 29 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class LaborCategory extends Model
->where('company_id', $cat->company_id)
->where('sort_order', '>=', $new)
->where('id', '!=', $cat->id ?? 0)
->increment('sort_order');
->increment('sort_order', 10);
}
});
}