From 4907f693e70aff0e27c097944215e21791617bbb Mon Sep 17 00:00:00 2001 From: Tom Lingham Date: Tue, 22 Jul 2014 20:45:52 +1000 Subject: [PATCH] Updated readme to fix error in method chaining logic #1 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 001bfd2..c9a4e0b 100644 --- a/README.md +++ b/README.md @@ -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