Docs Hub

🇮🇷
iran mirrors
LaravelLaravelLivewireLivewireAlpine.jsAlpine.jsNext.jsNext.jsVue.jsVue.jsZustandZustandNuxt.jsNuxt.jsFilamentFilament
BootstrapBootstrap
Nest.jsNest.js
ReactReact
Vite.jsVite.js
Tailwind CSSTailwind CSS

© 2026 Juza66 and Arash Fadaee

Docs Hub

🇮🇷 iran mirrorsActionsAGENTSAlpineAttribute AsyncAttribute ComputedAttribute DeferAttribute IsolateAttribute JsAttribute JsonAttribute LayoutAttribute LazyAttribute LockedAttribute ModelableAttribute OnAttribute ReactiveAttribute RenderlessAttribute SessionAttribute TitleAttribute TransitionAttribute UrlAttribute ValidateBest PracticesBlade ComponentsBundlingComponent HooksComponentsComputed PropertiesContribution GuideCspDirective IslandDirective PersistDirective PlaceholderDirective TeleportDirtyDownloadsEventsFormsHow Livewire WorksHydrationInstallationIslandsJavascriptLazyLifecycle HooksLoading StatesLockedMorphNavigateNestingOfflinePackagesPagesPaginationPollingPropertiesQuickstartRedirectingSecuritySession PropertiesStylesSynthesizersTeleportTestingThe Livewire ProtocolTroubleshootingUnderstanding NestingUndocumented Features TodoUpgrade Guide Scratch FileUpgradingUploadsUrlValidationVoltWire BindWire ClickWire CloakWire ConfirmWire CurrentWire DirtyWire IgnoreWire InitWire IntersectWire LoadingWire ModelWire NavigateWire OfflineWire PollWire RefWire ReplaceWire ShowWire SortWire StreamWire SubmitWire TextWire Transition
Docs Hub

After a user performs some action — like submitting a form — you may want to redirect them to another page in your application.

Because Livewire requests aren't standard full-page browser requests, standard HTTP redirects won't work. Instead, you need to trigger redirects via JavaScript. Fortunately, Livewire exposes a simple $this->redirect() helper method to use within your components. Internally, Livewire will handle the process of redirecting on the frontend.

If you prefer, you can use Laravel's built-in redirect utilities within your components as well.

Basic usage

Below is an example of a post.create Livewire component that redirects the user to another page after they submit the form to create a post:

php
<?php

use Livewire\Component;
use App\Models\Post;

new class extends Component {
	public $title = '';

    public $content = '';

    public function save()
    {
		Post::create([
			'title' => $this->title,
			'content' => $this->content,
		]);

		$this->redirect('/posts'); // [tl! highlight]
    }
};
?>

<form wire:submit="save">
    <!-- Form fields... -->
</form>

As you can see, when the save action is triggered, a redirect will also be triggered to /posts. When Livewire receives this response, it will redirect the user to the new URL on the frontend.

Redirect to Route

In case you want to redirect to a page using its route name you can use the redirectRoute.

For example, if you have a page with the route named 'profile' like this:

php
    Route::get('/user/profile', function () {
        // ...
    })->name('profile');

You can use redirectRoute to redirect to that page using the name of the route like so:

php
    $this->redirectRoute('profile');

In case you need to pass parameters to the route you may use the second argument of the method redirectRoute like so:

php
    $this->redirectRoute('profile', ['id' => 1]);

Redirect to intended

In case you want to redirect the user back to the previous page they were on you can use redirectIntended. It accepts an optional default URL as its first argument which is used as a fallback if no previous page can be determined:

php
    $this->redirectIntended('/default/url');

Redirecting to full-page components

Because Livewire uses Laravel's built-in redirection feature, you can use all of the redirection methods available to you in a typical Laravel application.

For example, if you are using a Livewire component as a full-page component for a route like so:

php
Route::livewire('/posts', 'pages::show-posts');

You can redirect to it simply by using the route path:

php
public function save()
{
    // ...

    $this->redirect('/posts');
}

Redirect to controller actions

If you want to redirect to a route handled by a controller action, you can use redirectAction():

php
$this->redirectAction([UserController::class, 'index']);

You can pass parameters to the controller action as the second argument:

php
$this->redirectAction([UserController::class, 'show'], ['id' => 1]);

Flash messages

In addition to allowing you to use Laravel's built-in redirection methods, Livewire also supports Laravel's session flash data utilities.

To pass flash data along with a redirect, you can use Laravel's session()->flash() method like so:

php
<?php

use Livewire\Component;

new class extends Component {
    // ...

    public function update()
    {
        // ...

        session()->flash('status', 'Post successfully updated.');

        $this->redirect('/posts');
    }
};
?>

Assuming the page being redirected to contain the following Blade snippet, the user will see a "Post successfully updated." message after updating the post:

blade
@if (session('status'))
    <div class="alert alert-success">
        {{ session('status') }}
    </div>
@endif

See also

  • Navigate — Use SPA navigation for redirects
  • Actions — Redirect after action completion
  • Forms — Redirect after successful form submission
  • Pages — Navigate between page components