Created
February 1, 2013 03:39
-
-
Save clouddueling/4689004 to your computer and use it in GitHub Desktop.
A better fulltext search for laravel returning eloquent objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function search_contacts($terms) | |
{ | |
$terms = mysql_real_escape_string($terms); | |
$contact_results = Contact::where_account_user_id(Auth::user()->account_user_id) | |
->raw_where("match (`first`, `last`) against ('{$terms}*' IN BOOLEAN MODE)") | |
->where_deleted(0) | |
->paginate(20); | |
phpconsole($contact_results->results); | |
return $contact_results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment