Created
July 3, 2025 20:55
-
-
Save mgussekloo/85f1901baceb8e0e244c4860c37dae1f to your computer and use it in GitHub Desktop.
Livewire example for Laravel Facet Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### 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