Skip to content

Is it possible to customize the PrivacyPolicyController and TermsOfService controller? #52900

Answered by dsebastien
dsebastien asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to do this by creating my own controller:

<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Inertia\Response;
use Laravel\Jetstream\Jetstream;

class PrivacyPolicyController extends Controller
{
  final public function show(): Response
  {
    // Fetch the privacy policy content from a file or database
    $policyContent = file_get_contents(Jetstream::localizedMarkdownPath('policy.md'));

    return Inertia::render('PrivacyPolicy', [
      'policy' => $policyContent,
    ]);
  }
}

And by configuring the route to use it: Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('privacy-policy.show');

No more dangerouslySetHtml: <ReactMarkdown>…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dsebastien
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant