inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.03k stars 227 forks source link

Restore request and session on redirects #539

Closed timacdonald closed 1 year ago

timacdonald commented 1 year ago

If there is an existing session on the redirect, it would be nice to restore it.

Inertia::location(
    redirect()->to('/login')
)->with('foo', 'bar');

Also restoring the request while I'm in there.

rojtjo commented 1 year ago

Wouldn't it make more sense to just return the original RedirectResponse instead of creating a new one? That way any other custom value such as the status code would also be preserved.

timacdonald commented 1 year ago

@rojtjo yes! yes it would. Was too close to the project. Changed the approach.

jessarcher commented 1 year ago

Thank you!