{{-- Read-only solution display for the QuestionResource form/view page. Resolves [[model:path]] -> (same route as question images), keeps
line breaks, and renders $$..$$ / \(..\) fractions with KaTeX (the Filament panel has no math renderer of its own). Rendered via a Blade View component (not a Placeholder closure) so Filament component caching can't break it. --}} @php $record = $getRecord(); $sols = $record ? \App\Models\Solution::where('question_id', $record->id)->orderByDesc('id')->get() : collect(); @endphp @if ($sols->isEmpty()) No solution saved for this question. @else @foreach ($sols as $s) @php $body = e((string) $s->solution); $body = str_replace('<br>', '
', $body); $body = preg_replace_callback('/\[\[model:([^\]]+)\]\]/', function ($m) { return 'bar model'; }, $body); @endphp
{!! $body !!}
@endforeach @endif