Reputation: 490
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?
Upvotes: 1
Views: 885
Reputation: 11
Yes, it is possible, try this
$htmlStr = Inertia::render('Claims/Show', ['claim' => $claim, 'permissions' => $permissions])->toResponse(new \Illuminate\Http\Request());
Upvotes: 1
Reputation: 2635
No, not possible. It renderes a view response that cannot be converted to a html string.
Upvotes: 1