# Redirect back after an Inertia form

> back() returns to the page that posted. to_route() is the right call when the next page is a specific list.

- URL: https://laravel-vuejs.space/inertia-redirect-back-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Inertia

People searching “Inertia redirect back” return `back()` from a create form and land on the create form again. That is what `back()` means. The [CRUD guide](https://laravel-vuejs.space/laravel-inertia-vue-crud) uses `to_route('posts.index')` after a save so the next page is the list.

> **TL;DR**
>
> -   back() returns to the page that posted.
> -   to\_route() is the right call when the next page is a specific list.
> -   Do not `return response()->json(['ok' => true])` from an Inertia action and then navigate in `onSuccess`.
> -   Do not `return back()` from a test and assert a JSON body.
>
> **Who it's for:** Laravel + Vue developers on Inertia
>
> **Applies to:** Laravel 13 · Inertia 3 · Vue 3

## The fix

Use `back()` when the user should stay where they were. A row button on the list is the usual case:

```php
public function publish(Request $request, Post $post): RedirectResponse
{
    $this->authorize('update', $post);
    $post->update(['published_at' => now()]);

    return back();
}
```

Inertia follows the redirect. The Vue page does not call `router.visit` after `form.post` unless you are doing something the redirect cannot express.

Use `to_route()` when the destination is fixed. Use `redirect()->route('posts.edit', $post)` after create when the next step is the editor.

## What to avoid

> **Gotcha**
>
> Do not `return response()->json(['ok' => true])` from an Inertia action and then navigate in `onSuccess`. You dropped the redirect Inertia is built around. Do not `return back()` from a test and assert a JSON body.

## FAQ

**Q: How do I redirect back after an Inertia form?**

back() returns to the page that posted. to\_route() is the right call when the next page is a specific list.

**Q: What goes wrong with Inertia redirect back?**

Many developers return `back()` from a create form and land on the create form again. Do not `return response()->json(['ok' => true])` from an Inertia action and then navigate in `onSuccess`.
