update benefit import

This commit is contained in:
ivan-sim
2026-04-10 13:52:02 +07:00
parent 88be6605c2
commit 5dbad1f6a2

View File

@@ -245,14 +245,13 @@ class CorporateService
->where('corporate_plan_id', $benefit_data['plan_code'])
->first();
$benefit_data['plan_code'] = $plan->id;
$benefit = Benefit::updateOrCreate([
$benefit = Benefit::firstOrCreate([
'code' => $benefit_data['code'],
'service_code' => $plan->service_code,
], [
'code' => $benefit_data['code'],
'service_code' => $plan->service_code,
'description' => $benefit_data['description'],
'description' => $benefit_data['description'], // hanya initial
]);
$corporateBenefit = $corporate->corporateBenefits()->updateOrCreate([
'benefit_id' => $benefit->id,
'plan_id' => $plan->id,