get(['id', 'stem']); foreach ($questions as $question) { $assets = $svgService->extractSvgAssets($question->stem ?? ''); foreach ($assets as $asset) { QuestionAsset::firstOrCreate([ 'question_id' => $question->id, 'asset_type' => $asset['type'] ?? 'svg', 'path' => $asset['path'] ?? '', ], [ 'meta' => $asset['meta'] ?? [], ]); } } $this->info('Question assets synced.'); return self::SUCCESS; } }