styleHtmlContent($htmlContent); return Inertia::render('FrontPages/Privacy', [ 'content' => $styledContent, 'title' => 'Privacy Policy', ]); } public function terms() { $markdownPath = resource_path('markdown/terms.md'); $markdownContent = file_get_contents($markdownPath); // Parse markdown to HTML using Laravel's built-in Str::markdown helper $htmlContent = Str::markdown($markdownContent); // Style the HTML with Tailwind classes $styledContent = $this->styleHtmlContent($htmlContent); return Inertia::render('FrontPages/Terms', [ 'content' => $styledContent, 'title' => 'Terms & Conditions', ]); } private function styleHtmlContent($html) { // Add classes to various HTML elements using string replacement for Tailwind 4 $html = preg_replace('/
]*)>/', '
', $html); $html = preg_replace('/
]*)>/', '', $html); $html = preg_replace('/]*)>/', '', $html); $html = preg_replace('/]*)>/', '', $html); return $html; } }