Skip to content

Commit faf1913

Browse files
committed
Update README.md
1 parent f65a730 commit faf1913

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This Laravel package allows you to search through multiple Eloquent models. It supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.
1010

11-
### 📺 Curious about an implementation? Watch the live stream on 28 October at 14:00 CET: [https://youtu.be/WigAaQsPgSA](https://youtu.be/WigAaQsPgSA)
11+
### 📺 Want to watch an implementation of this package? Rewatch the live stream (skip to 13:44 for the good stuff): [https://youtu.be/WigAaQsPgSA](https://youtu.be/WigAaQsPgSA)
1212

1313
## Requirements
1414

@@ -50,6 +50,15 @@ $results = Search::add(Post::class, 'title')
5050
->get('howto');
5151
```
5252

53+
If you care about indentation, you can optionally use the `new` method on the facade:
54+
55+
```php
56+
Search::new()
57+
->add(Post::class, 'title')
58+
->add(Video::class, 'title')
59+
->get('howto');
60+
```
61+
5362
### Sorting
5463

5564
If you want to sort the results by another column, you can pass that column to the `add` method as a third parameter. Call the `orderByDesc` method to sort the results in descending order.
@@ -137,6 +146,17 @@ Search::add(Post::with('comments'), 'title')
137146
->get('guitar');
138147
```
139148

149+
### Getting results without searching
150+
151+
If you call the `get` method without a term or with an empty term, the package throws an `EmptySearchQueryException`. You can disable this behaviour with the `allowEmptySearchQuery` method.
152+
153+
```php
154+
Search::add(Post::with('comments'), 'title')
155+
->add(Video::with('likes'), 'title')
156+
->allowEmptySearchQuery()
157+
->get();
158+
```
159+
140160
### Standalone parser
141161

142162
You can use the parser with the `parseTerms` method:

0 commit comments

Comments
 (0)