title: Trying to get a Search bar to work in laravel 5
body: <p>I'm trying to get a search bar to go through my database and grab all the numbers that include these 2 random numbers a user will input.  The 2 consecutive numbers can be anywhere in the string and then it should grab the whole string.  One issue I'm having is that the form is in the layout (maybe it doesn't matter, but i would still like to know how i can put the layout in a controller and include it in other methods)so it doesn't have it's own method and the form itself i'm trying to route to another view with the search results appearing.  As of right now this is the error I'm getting: <code>Missing argument 1 for App\Http\Controllers\SearchController::SearchEngine()</code> </p>
  
  <p>In my layout:</p>
  
  <pre><code>{!! Form::open(array('method' =&gt; 'GET', 'url' =&gt; 'search_engine')) !!}
      &lt;div class="form-group"&gt;
          {!! Form::label('SEARCH:') !!}
          {!! Form::text('search', null, ['class' =&gt; 'form-control',
            'placeholder' =&gt;'(NSN or PN)', 'size' =&gt; '20']) !!}
          {!! Form::submit('Submit', ['class' =&gt; 'btn btn-primary form-control']) !!}
      &lt;/div&gt;
  {!! Form::close() !!}
  </code></pre>
  
  <p>In my Routes:
  `Route::get('search_engine', 'SearchController@SearchEngine');</p>
  
  <p>In my controller:</p>
  
  <pre><code> public function SearchEngine($i)
      {
          $search = input::get('search');
          $terms = explode(" ", $search);
          $query = fsgdata::where('fsg_number')-&gt;get();
  
          foreach($terms as $each) {
              $i++;
              if($i == 1) {
                  $query .= "fsg_number LIKE '%$each%' ";
                  echo $each;
              }
              else {
                  $query .= "0R fsg_number LIKE '%$each%' ";
              }
          }
  
      // connect
          mysql_connect("localhost", "USERNAME", "PASSWORD");
          mysql_select_db("DB_NAME");
  
          $query = mysql_query($query);
          $numrows = mysql_num_rows($query);
          if ($numrows &gt; 0) {
  
              while ($row = mysql_fetch_assoc($query)) {
                  $fsg_number = $row['fsg_number'];
  
                  echo "&lt;h2&gt;$fsg_number&lt;/h2&gt;";
              }
          }
          else {
          }
  
      // disconnect
          mysql_close();
  
          return View('Partials.search_form');
      }
  </code></pre>
  
  <p>And my view is just another search bar etc.</p>
  
  <p>Unfortunately, maybe I'm a dumb dumb, but laravels docs doesn't go into much detail about any of their features and instead choose to do a one and done example picture style. I'm new to laravel period so to me to task of filling in the dots can be very daunting.  </p>