Livewire URL Query Parameters: Shareable States
December 24, 2025
•
1 min read
•
35 views
Table of Contents
Sync state with URL:
Define URL Parameters
use Livewire\Attributes\Url;
class SearchPosts extends Component
{
#[Url]
public $search = '';
#[Url]
public $category = 'all';
}
Keep History
#[Url(history: true)]
public $page = 1;
Custom Parameter Name
#[Url(as: 'q')]
public $search;
Users can bookmark and share filtered states!
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!