Laravel PurityLaravel Purity
Introduction
  • Installation
  • Basic Usage
  • Additional Tutorials
  • Available Filters
  • Filtering
  • Sorting
  • Rename Fields
  • Relation Fields
  • Params Source
  • Allowed Fields
  • Livewire
  • Silent Exceptions
  • Filter

    • Restrict
    • Custom Filters
  • Sort

    • Null Sort
  • Upgrade Guide
Client Package
Ask a Question
GitHub
Introduction
  • Installation
  • Basic Usage
  • Additional Tutorials
  • Available Filters
  • Filtering
  • Sorting
  • Rename Fields
  • Relation Fields
  • Params Source
  • Allowed Fields
  • Livewire
  • Silent Exceptions
  • Filter

    • Restrict
    • Custom Filters
  • Sort

    • Null Sort
  • Upgrade Guide
Client Package
Ask a Question
GitHub
  • Livewire

    • Livewire

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

Edit this page
Last Updated:
Contributors: Abbas mkhzomi
Prev
Allowed Fields
Next
Silent Exceptions