title: Laravel 4/5 search form like
body: <p>I have a search form and functions, all done. Just to ask, is it possible to do it in Eloquent a query like this:</p>
  
  <pre><code>SELECT * FROM players WHERE name LIKE '%".$name."%'
  </code></pre>
  
  <p>To display some possible matching names. My current controller function:</p>
  
  <pre><code>    public function search()
  {
      $name = Input::get('character');
      $searchResult = Player::where('name', '=', $name)-&gt;paginate(1);
      return View::make('search.search')
              -&gt;with('name', $name)
              -&gt;with('searchResult', $searchResult);
  }
  </code></pre>
  
  <p>And my view:</p>
  
  <pre><code>    &lt;form id="custom-search-form" class="form-search form-horizontal pull-right" action="{{ URL::action('CharactersController@search') }}" method="get"&gt;
      &lt;div class="input-append spancustom"&gt;
          &lt;input type="text" class="search-query" name="character" placeholder="Character/guild name"&gt;
          &lt;button type="submit" class="btn"&gt;&lt;i class="icon-search"&gt;&lt;/i&gt;&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>