input('content', ''); $type = $request->input('type', 'section'); // header, footer, section // Validate type if (!in_array($type, ['header', 'footer', 'section'])) { $type = 'section'; } $html = TemplatePreviewService::getPreviewHtml($content, $type); return response($html) ->header('Content-Type', 'text/html; charset=utf-8'); } }