Updated readme to fix error in method chaining logic #1

This commit is contained in:
Tom Lingham
2014-07-22 20:45:52 +10:00
parent 51eb6483dd
commit 4907f693e7

View File

@ -39,12 +39,14 @@ $users = Searchy::users('name')->query('John Smith');
you can also write this as:
```php
$users = Searchy::search('users')->query('John Smith');
$users = Searchy::search('users')->fields('name', 'email')->query('John Smith');
```
In this case, pass the columns you want to search through to the `fields()` method.
These example both return a Laravel DB Query Builder Object, so you will need to chain `get()` to actually return the results in a usable object:
```php
$users = Searchy::search('users')->query('John Smith')->get();
$users = Searchy::search('users')->fields('name', 'email')->query('John Smith')->get();
```
#### Searching multiple Columns