@php $editId = (int) request('edit'); $row = $editId ? $faqs->firstWhere('id', $editId) : null; $open = $row || request()->has('new') || $errors->any(); $live = $faqs->where('published', true)->count(); $contexts = $faqs->pluck('context')->filter()->unique()->sort()->values(); $groups = $faqs->groupBy(fn ($f) => $f->context ?: 'general'); @endphp @if($open)
@csrf

{{ $row ? 'Edit FAQ' : 'New FAQ' }}

Cancel
Answer directly in the first sentence, then add detail. Plain text only.
@error('answer')
{{ $message }}
@enderror
@foreach($contexts as $c)
Questions are grouped by category on the FAQ page. Empty becomes “general”.
@error('context')
{{ $message }}
@enderror
@endif

Frequently asked questions

{{ $faqs->count() }} total · {{ $live }} published · also feeds the FAQPage structured data used by search and AI answers
@unless($open) New FAQ@endunless
@if($faqs->isEmpty()) Add the first FAQ @else
@foreach($groups as $ctx => $items) @foreach($items as $f) @endforeach @endforeach
QuestionCategoryOrderStatusActions
{{ $f->question }}{{ \Illuminate\Support\Str::limit($f->answer, 110) }} {{ $ctx }} {{ $f->sort_order }}
@csrf
@csrf @method('DELETE')
@endif