Mahmoud Al-HabashOpen to new projects
  • WorkWork
  • ServicesServices
  • LabLab
  • WritingWriting
  • ContactContact
Amman--:--عربي
Writing/Livewire

Route::livewire() - The New Routing Standard in Livewire v4

Learn the recommended way to route full-page Livewire components.

1 February 20261 min readLivewireاقرأ بالعربية

On this page

  1. Before (v3)
  2. After (v4)

Livewire v4 introduces Route::livewire() as the preferred routing method.

Before (v3)

php
Route::get('/dashboard', Dashboard::class);

After (v4)

php
Route::livewire('/dashboard', Dashboard::class);

// For view-based components
Route::livewire('/dashboard', 'pages::dashboard');

// With middleware
Route::livewire('/dashboard', Dashboard::class)
    ->middleware(['auth']);
All articles

Keep reading

  • Authorization in Livewire v4 Components1 February 20261 min read
  • Blaze Pre-Compiler: Massive Performance Gains in Livewire v41 February 20261 min read
  • Building a Bookmark Feature with Livewire v41 February 20261 min read