title: Laravel 5.0 query database using a form
body: <p>I am new to Laravel 5.0 and I'm having trouble using a form to query a database and return the results to a view. Form accepts user input for week number and this week number should be used to query the database table. Any help would be appreciated.</p>
  
  <p>Form inside my view</p>
  
  <pre><code>&lt;form action="" method="get"&gt;
      {{ csrf_field() }}
      &lt;div class="input-group"&gt;
         &lt;input type="text" class="form-control" name="weekNum" placeholder="Typein Week Number"&gt; 
         &lt;span class="input-group-btn"&gt; 
             &lt;button type="submit" class="btn btn-default"&gt;
                 &lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt;
             &lt;/button&gt;
         &lt;/span&gt;
     &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Route::get('/search', 'shopsalescontroller@index');</p>
  
  <p>Controller</p>
  
  <pre><code>class shopsalescontroller extends Controller
  {
      public function index()
      {
          $weekNum = Request::input('WeekNumber');
          $result = shopsales::where('WeekNumber','=',$weekNum)-&gt;get();
          return $result; 
      }
  }
  </code></pre>