Browse Source

Updated readme to fix error in method chaining logic #1

master
Tom Lingham 11 years ago
parent
commit
4907f693e7
  1. 6
      README.md

6
README.md

@ -39,12 +39,14 @@ $users = Searchy::users('name')->query('John Smith');
you can also write this as: you can also write this as:
```php ```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: 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 ```php
$users = Searchy::search('users')->query('John Smith')->get();
$users = Searchy::search('users')->fields('name', 'email')->query('John Smith')->get();
``` ```
#### Searching multiple Columns #### Searching multiple Columns

Loading…
Cancel
Save