title: MySQL/PHP Boolean Fulltext Search Issue in Laravel 4
body: <p>I have the following code that searches my models in Laravel 4 for a search phrase. It uses  'IN BOOLEAN MODE' and MATCH() and AGAINST().</p>
  
  <pre><code>public function scopeSearch($query, $q) 
  {
      $fields = Static::getFields();
      $fields = implode(', ', $fields);
  
      $query-&gt;whereRaw("MATCH(" . $fields . ") AGAINST('" . $q . "' IN BOOLEAN MODE)");
  }
  
  public static function getFields()
  {
      $field_names = array();
      $disallowed = array('id', 'created_at', 'updated_at', 'deleted_at');
  
      $columns = DB::select('SHOW COLUMNS FROM accounts');
      foreach ($columns as $c) {
          $field = $c-&gt;Field;
          if ( ! in_array($field, $disallowed)) {
              $field_names[$field] = $field;
          }
      }
  
      return $field_names;
  }
  </code></pre>
  
  <p>I'd like help modifying the code above to allow a user to search the fields using partial words and phrases. For example, if a user types purple, I'd like the search to also find any records with email addresses containing the word purple, so info@purplegriffon.com. So, essentially partial matches.</p>
  
  <p>I'd also like to be able to find everything containing griffon in the field for the typed phrase john griffon, even if john does not exist.</p>
  
  <p>Can anyone help me out with this? Cheers.</p>