Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mgussekloo/85f1901baceb8e0e244c4860c37dae1f to your computer and use it in GitHub Desktop.
Save mgussekloo/85f1901baceb8e0e244c4860c37dae1f to your computer and use it in GitHub Desktop.
Livewire example for Laravel Facet Filter
### Livewire example
This is how it could look using Livewire.
``` html
<h2>Colors</h2>
@foreach ($facet->getOptions() as $option)
<div class="facet-checkbox-pill">
<input
wire:model="filter.{{ $facet->getParamName() }}"
type="checkbox"
id="{{ $option->slug }}"
value="{{ $option->value }}"
/>
<label for="{{ $option->slug }}" class="{{ $option->selected ? 'selected' : '' }}">
{{ $option->value }} ({{ $option->total }})
</label>
</div>
@endforeach
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment