In this example, we’ve preset values on the <livewire-collection> tag — specifically for the car_brand taxonomy and a default sort option. This lets you see how the filters behave when values are already set.
We also added an LfDateFilter to let users filter results by car registration date.
1<div class="my-8 xl:my-12" id="livewire-collection">
2 <div class="grid grid-cols-12 mb-8">
3 <div class="col-span-2 col-start-11">
4 {{ livewire:lf-sort
5 blueprint="cars.car"
6 fields="seats|doors"
7 }}
8 </div>
9 </div>
10 <div class="grid grid-cols-12 gap-8 lg:gap-12 xl:gap-16">
11 <div class="col-span-3">
12 <div class="mb-8">
13 <div class="mb-2 font-bold">
14 Date of registration is after
15 </div>
16 {{ livewire:lf-date-filter
17 blueprint="cars.car"
18 field="date_of_registration"
19 condition="is_after"
20 }}
21 </div>
22 <div class="mb-8">
23 <div class="mb-2 font-bold">
24 Car brand
25 </div>
26 {{ livewire:lf-checkbox-filter
27 blueprint="cars.car"
28 field="car_brand"
29 condition="taxonomy"
30 }}
31 </div>
32 <div class="mb-8">
33 <div class="mb-2 font-bold">
34 Special category
35 </div>
36 {{ livewire:lf-checkbox-filter
37 blueprint="cars.car"
38 field="special_categories"
39 condition="query_scope"
40 modifier="multiselect"
41 }}
42 </div>
43 <div class="mb-8">
44 <div class="mb-2 font-bold">
45 Transmission
46 </div>
47 {{ livewire:lf-select-filter
48 blueprint="cars.car"
49 field="transmission"
50 condition="is"
51 }}
52 </div>
53 <div class="mb-8">
54 <div class="mb-2 font-bold">
55 Fuel type
56 </div>
57 {{ livewire:lf-select-filter
58 blueprint="cars.car"
59 field="fuel_type"
60 condition="is"
61 }}
62 </div>
63 </div>
64 <div class="col-span-9">
65 <div class="mb-4">
66 {{ livewire:lf-tags blueprint="cars.car" fields="date_of_registration|car_brand|special_categories|transmission|fuel_type" }}
67 </div>
68 <div class="@container">
69 <div>
70 {{ livewire-collection:cars
71 paginate="6"
72 taxonomy:car_brand:any="toyota|hyundai|vw"
73 sort="seats:desc"
74 }}
75 </div>
76 </div>
77 </div>
78 </div>
79</div>