fix: add unique constraint to split and dividends

to prevent duplicate records
This commit is contained in:
hackerESQ
2025-03-19 16:16:38 -05:00
parent 9bcc80078e
commit 261c848ffd
5 changed files with 15 additions and 18 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class Split extends Model
if ($split_data->isNotEmpty()) {
// insert records
(new self)->insert($split_data->map(function ($split) {
(new self)->insertOrIgnore($split_data->map(function ($split) {
return [...$split, ...['id' => Str::uuid()->toString()]];
})->toArray());