@php use App\Helpers\SchemaCollector; $faqItems = collect($faqs ?? [])->filter(fn($faq) => !empty($faq->question) && !empty($faq->answer)) ->map(fn($faq) => [ '@type' => 'Question', 'name' => $faq->question, 'acceptedAnswer' => [ '@type' => 'Answer', 'text' => $faq->answer, ], ])->values()->toArray(); if(!empty($faqItems)) { SchemaCollector::addFaqs($faqItems); } @endphp