fill(Arr::except($request->validated(), 'file')); if ($request->filled('file')) { $claimModel->file = FileHelper::storeBase64File('claim', $request->file, private: true); } if (!$claimModel->saveOrFail()) { throw new CrmException('Api failed to store claim.'); } $claimModel->brand()->associate($service->brand); return response()->json(); } }