Skip to content

Instantly share code, notes, and snippets.

@sineld
Forked from clouddueling/fulltextsearch.php
Created December 4, 2012 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sineld/4201432 to your computer and use it in GitHub Desktop.
Save sineld/4201432 to your computer and use it in GitHub Desktop.
Fulltext search with Laravel
public static function read_search($terms, $limit = 10)
{
$contact_results = DB::query("
select *
from contacts
where `account_user_id`=?
and `deleted`='0'
and `marketing`='0'
and `mass_merge`='0'
and match (`first`, `last`) against (?)
limit ?
", array(Auth::user()->account_user_id, $terms, $limit));
return $contact_results;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment