Home API Tools Posts Hire Me About
Sign In Create Account
Livewire

Building a Search Component in Livewire v4

February 01, 2026 1 min read 29 views

Build a performant search component.

Component

use Livewire\Attributes\Url;

class SearchProducts extends Component
{
    #[Url]
    public string $query = '';
}

Template


@foreach(Product::search($query)->get() as $p)
    
{{ $p->name }}
@endforeach
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!