PHP code example of rossjcooper / laravel-amazon-products

1. Go to this page and download the library: Download rossjcooper/laravel-amazon-products library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rossjcooper / laravel-amazon-products example snippets


public function handle(\Rossjcooper\LaravelAmazonProducts\API $api)
{
     $request = new SearchItemsRequest();
        $request->setSearchIndex('All');
        $request->setKeywords('Harry Potter');
        $request->setResources([
            SearchItemsResource::ITEM_INFOTITLE,
            SearchItemsResource::OFFERSLISTINGSPRICE,
        ]);
        $request->setPartnerTag(config('mypartnertag'));
        $request->setPartnerType(config('Associates'));

        $response = $api->searchItems($request);

        foreach($response->getSearchResult()->getItems() as $item) {
            //...
        }
}