title: Integrating Amazon Product Search API to laravel
body: <p>i am building a website with a search-bar that queries amazon books and sorts by book category and by relevance. I made a form on my layout as follows: </p>
  
  <pre><code>  {{ Form::open(array('action' =&gt; 'home/api', 'method' =&gt; 'GET', 'class' =&gt; 'search1')) }}
          {{ Form::text('booksearch', 'Search...', array('class' =&gt; 'searchinput searchbooks', 'placeholder' =&gt; 'Search...')) }}
              {{ Form::select('category', array(
                  '1' =&gt; 'All Books',
                  '2' =&gt; 'All Textbooks',
                  '3' =&gt; 'Business &amp; Finance Textbooks',
                  '4' =&gt; 'Communication &amp; Journalism Textbooks',
                  '5' =&gt; 'Computer Science Textbooks',
                  '6' =&gt; 'Education Textbooks',
                  '7' =&gt; 'Engineering Textbooks',
                  '8' =&gt; 'Humanities Textbooks',
                  '9' =&gt; 'Law Textbooks',
                  '10' =&gt; 'Medicine &amp; Health Sciences Textbooks',
                  '11' =&gt; 'Reference Textbooks',
                  '12' =&gt; 'Science &amp;amp; Mathematics Textbooks',
                  '13' =&gt; 'Social Sciences Textbooks'
  
              ), '1', array('class'=&gt;'btn btn-primary')) }}
  
              {{ Form::select('sort', array(
                  '1' =&gt; 'Relevance',
                  '2' =&gt; 'Alphabetical: A to Z',
                  '3' =&gt; 'Alphabetical: Z to A',
                  '4' =&gt; 'Bestselling',
                  '5' =&gt; 'Average customer review',
                  '6' =&gt; 'Price: low to high',
                  '7' =&gt; 'Price: high to low',
                  '8' =&gt; 'Publication date: newer to older'
  
              ), '1', array('class'=&gt;'btn btn-primary')) }}
  
              {{ Form::submit('Search', array('class'=&gt;'btn btn-primary submitbook')) }}
  
      {{ Form::close() }}
  </code></pre>
  
  <p>I have this in my routes.php: </p>
  
  <pre><code>Route::controller('/', 'HomeController');
  Route::controller('home/api', 'HomeController@Search');
  </code></pre>
  
  <p>On my HomeController:</p>
  
  <pre><code>public function getIndex()
  {
      return View::make('home.index');
  }
  public function getSearch()
  {
      return View::make('home.api');
  }
  </code></pre>
  
  <p>Then I set up an api file where my form will submit under views/home/api.blade.php with the following code:</p>
  
  <pre><code> &lt;?php
  //Enter your IDs
  define("Access_Key_ID", "myaccesskeyhere");
  define("Associate_tag", "x00a7-20");
  //Set up the operation in the request
  
  
  if(!empty($_GET['booksearch']) &amp;&amp; !empty($_GET['category']) &amp;&amp; !empty($_GET['sort'])) {
      $booksearch = '';
      $category = '';
      $sort = '';
      $SearchIndex = '';
      $Keywords = '';
  }
  
  
  function ItemSearch($SearchIndex, $Keywords){
  //Set the values for some of the parameters
  $Operation = "ItemSearch";
  $Version = "2011-08-01";
  $ResponseGroup = "ItemAttributes,Offers";
  //User interface provides values
  //for $SearchIndex and $Keywords
  
  //Define the request
  $request=
  "http://webservices.amazon.com/onca/xml"
  . "?Service=AWSECommerceService"
  . "&amp;AssociateTag=" . Associate_tag
  . "&amp;AWSAccessKeyId=" . Access_Key_ID
  . "&amp;Operation=" . $Operation
  . "&amp;Version=" . $Version
  . "&amp;SearchIndex=" . $SearchIndex
  . "&amp;Keywords=" . $Keywords
  . "&amp;Signature=" . [Request Signature]
  . "&amp;ResponseGroup=" . $ResponseGroup;
  //Catch the response in the $response object
  $response = file_get_contents($request);
  $parsed_xml = simplexml_load_string($response);
  printSearchResults($parsed_xml, $SearchIndex);
  }
  ?&gt;
  </code></pre>
  
  <p>Please let me know where im going wrong because I get this error when I try to access the form:</p>
  
  <pre><code>Class HomeController@Search does not exist
  </code></pre>