@@ -62,13 +62,13 @@ If you just need the generated query from the builder then call `->compile()` in
6262
6363## Builder Methods
6464
65- #### where(column, operator(optional), value(optional), boolean(optional))
65+ #### # where(column, operator(optional), value(optional), boolean(optional))
6666
6767``` php
6868FilterBuilder::where('name', 'Chris')->compile(); // "name = 'Chris'"
6969```
7070
71- #### orWhere(column, operator(optional), value(optional))
71+ #### # orWhere(column, operator(optional), value(optional))
7272
7373``` php
7474FilterBuilder::orWhere('name', 'Chris')->compile(); // "name = 'Chris'"
@@ -78,13 +78,13 @@ FilterBuilder::where('name', 'Bob')
7878 ->compile(); // "name = 'Bob' OR name = 'Chris'"
7979```
8080
81- #### whereIn(column, value(optional))
81+ #### # whereIn(column, value(optional))
8282
8383``` php
8484FilterBuilder::whereIn('name', ['Chris', 'Bob'])->compile(); // "name IN ['Chris','Bob']"
8585```
8686
87- #### orWhereIn(column, value(optional))
87+ #### # orWhereIn(column, value(optional))
8888
8989``` php
9090FilterBuilder::orWhereIn('name', ['Chris', 'Bob'])->compile(); // "name IN ['Chris','Bob']"
9393 ->orWhereIn('name', ['Chris', 'Bob'])->compile(); // "email = '
[email protected] ' OR name IN ['Chris','Bob']"
9494```
9595
96- #### whereNotIn(column, value(optional))
96+ #### # whereNotIn(column, value(optional))
9797
9898``` php
9999FilterBuilder::whereNotIn('name', ['Chris', 'Bob'])->compile(); // "name NOT IN ['Chris','Bob']"
100100```
101101
102- #### orWhereNotIn(column, value(optional))
102+ #### # orWhereNotIn(column, value(optional))
103103
104104``` php
105105FilterBuilder::where('email', '
[email protected] ')
106106 ->orWhereNotIn('name', ['Chris', 'Bob'])->compile(); // "email = '
[email protected] ' OR name NOT IN ['Chris','Bob']"
107107```
108108
109- #### whereNot(column, value(optional))
109+ #### # whereNot(column, value(optional))
110110
111111``` php
112112FilterBuilder::whereNot('name', 'Chris')->compile(); // => "NOT name 'Chris'"
113113```
114114
115- #### orWhereNot(column, value(optional))
115+ #### # orWhereNot(column, value(optional))
116116
117117``` php
118118FilterBuilder::where('email', '
[email protected] ')
119119 ->orWhereNot('name', 'Chris')->compile(); // => "email = '
[email protected] ' OR NOT name 'Chris'"
120120```
121121
122- #### whereIsEmpty(column)
122+ #### # whereIsEmpty(column)
123123
124124``` php
125125FilterBuilder::whereIsEmpty('name')->compile(); // => "name IS EMPTY"
126126```
127127
128- #### orWhereIsEmpty(column)
128+ #### # orWhereIsEmpty(column)
129129
130130``` php
131131FilterBuilder::whereNot('name', 'Chris')
132132 ->orWhereIsEmpty('name')
133133 ->compile(); // => "NOT name 'Chris' OR name IS EMPTY"
134134```
135135
136- #### whereTo(column, from, to)
136+ #### # whereTo(column, from, to)
137137
138138``` php
139139FilterBuilder::whereTo('count', 1, 10)->compile(); // => "count 1 TO 10"
140140```
141141
142- #### orWhereTo(column, from, to)
142+ #### # orWhereTo(column, from, to)
143143
144144``` php
145145FilterBuilder::where('email', '
[email protected] ')
146146 ->orWhereTo('count', 1, 10)->compile(); // => "email = '
[email protected] ' OR count 1 TO 10"
147147```
148148
149- #### whereExists(column)
149+ #### # whereExists(column)
150150
151- #### orWhereExists(column)
151+ #### # orWhereExists(column)
152152
153- #### whereIsNull(column)
153+ #### # whereIsNull(column)
154154
155- #### orWhereIsNull(column)
155+ #### # orWhereIsNull(column)
156156
157157### Nested / grouped queries
158158
@@ -165,6 +165,14 @@ FilterBuilder::where(fn ($query) => $query
165165->compile(); // => "(NOT name 'Chris' OR name IS EMPTY) OR email = '
[email protected] '"
166166```
167167
168+ ### Sorting
169+
170+ In addition to the above methods, you can also call sort on the builder instance as follows:
171+
172+ ``` php
173+ FilterBuilder::where('name', 'Chris')->sort('name', 'desc')->compile();
174+ ```
175+
168176### Supported search engine operators
169177
170178Docs: [ Meilisearch operators] ( https://www.meilisearch.com/docs/learn/filtering_and_sorting/filter_expression_reference#filter-operators )
0 commit comments