PHP code example of ireisaac / mws

1. Go to this page and download the library: Download ireisaac/mws 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/ */

    

ireisaac / mws example snippets


// in your config/app.php

'providers' => [
	...
	IreIsaac\Mws\Support\MwsServiceProvider::class,
],

'aliases' => [
	...
	'Mws'       => IreIsaac\Mws\Support\MwsFacade::class,
],

use Mws;
use Carbon\Carbon;

public function search($query)
{
	$response = Mws::listMatchingProducts(['Query' => $query]);

	return $response->xml();
}

public function orders()
{
	// Orders from the last week
	$response = Mws::ListOrders([
		'CreatedAfter' => Carbon::now()->subWeek()->toIso8601String()
	]);

	return $response->xml();
}
bash
php artisan vendor:publish