Livewire
to add filter to your livewire app, first define $filters
variable in your component and pass it to filter or sort method:
// component
#[Url]
public $filters = [
'title' => [],
];
public function render()
{
$transactions = Transaction::filter($this->filters)->get();
return view('livewire.transaction-table',compact('transactions'));
}
then bind the variable in your blade template.
<!-- in blade template -->
<input type="text" wire:model.live="filters.title.$eq" placeholder="title" />
read more in livewire docs