Only until March 18th: coupon LARAVEL12 for 40% off Yearly/Lifetime membership!

Read more here
Courses

Livewire 3 From Scratch: Practical Course

SPA Feeling with wire:navigate

Summary of this lesson:
- Adding wire:navigate for SPA experience
- Configuring loading indicators
- Managing script reloading
- Implementing SPA redirects

These days, many applications are built as single-page applications (SPA). Livewire v3 offers a single-page application experience.


Basic Usage

To use this feature, you just need to add a wire:navigate directive to the navigation link. For example, if we have a couple of routes.

Route::get('posts', \App\Livewire\ShowPosts::class);
Route::get('posts/create', \App\Livewire\CreatePost::class);
Route::get('users', \App\Livewire\ShowUsers::class);

Then we add wire:navigate to each link.

<nav>
<a href="/posts" wire:navigate>Posts</a>
<a href="/posts/create" wire:navigate>Create Post</a>
<a href="/users" wire:navigate>Users</a>
</nav>

After clicking a link, Livewire will load the new page in the background, and only then will...

The full lesson is only for Premium Members.
Want to access all 30 lessons of this course? (108 min read)

You also get:

  • 71 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord