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:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user