questionId); if (!$question) { return; } $assets = $service->extractSvgAssets($question->stem ?? ''); foreach ($assets as $asset) { QuestionAsset::firstOrCreate([ 'question_id' => $question->id, 'asset_type' => $asset['type'] ?? 'svg', 'path' => $asset['path'] ?? '', ], [ 'meta' => $asset['meta'] ?? [], ]); } } }