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