inertia-laravel
inertia-laravel copied to clipboard
No cookie method with render?
As I understand it, Response should be able to add a cookie with withCookie(). https://www.tutsmake.com/laravel-cookies-get-set-delete-cookies/
However that is a bad call when trying that with Inertia:
return Inertia::render('MyView', $props)->withCookie($cookie);
gives an error:
Bad Method Call
Did you mean Inertia\Response::with() ?
Good question! I couldn't find a way to set cookies when using Inertia::render.
I am also looking for this. Did you find any way to do it?
Ok, I found a way. Just use queue
method from Cookie
facade.
Hey there,
We're closing this issue because it's inactive, already solved, old or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.