1

I have a laravel jetstream application where I would like to render a vue view into a html string which i will then process elsewhere.

I would like to have

$htmlStr = Inertia::render('Claims/Show', ['claim' => $claim,  'permissions' => $permissions]);

Is there a way to render inertia templates as a string?

2 Answers 2

1

No, not possible. It renderes a view response that cannot be converted to a html string.

Sign up to request clarification or add additional context in comments.

1 Comment

Do you think if theres any way around that? Like a way to get php/laravel to render the vue templates into a html string?
1

Yes, it is possible, try this

$htmlStr = Inertia::render('Claims/Show', ['claim' => $claim,  'permissions' => $permissions])->toResponse(new \Illuminate\Http\Request());

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.