PHP code example of jeffgreco13 / laravel-wave

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

    

jeffgreco13 / laravel-wave example snippets


use Jeffgreco13\Wave\Currency;

$currencies = Currency::all(); // returns a Collection of Currency objects

$currency = Currency::firstWhere('code','ARS'); // returns a single Currency object if found, or null
echo $currency->name; // output: Argentinian peso

// Currency array attributes
array:5 [
  "code" => "ARS"
  "symbol" => "$"
  "name" => "Argentinian peso"
  "plural" => "Argentinian pesos"
  "exponent" => 2
]


$wave = new \Jeffgreco13\Wave\Wave();
$businesses = $wave->businesses();

$wave = new \Jeffgreco13\Wave\Wave();
$country = $wave->country(['code' => 'US']);

$wave = new Wave();
$response = $wave->customers(['pageSize'=>20]);
do {
    foreach ($wave->getNodes() as $node) {
        echo "Hello, {$node->firstName}!";
    }
} while($response = $wave->paginate());

$wave = new \Jeffgreco13\Wave\Wave();
$customer = [
    "input" => [
        "businessId" => null, // Optional. Will use the businessId from your config/env by default
        "name" => "Genevieve Heidenreich",
        "firstName" => "Genevieve",
        "lastName" => "Heidenreich",
        "displayId" => "Genevieve",
        "email" => "[email protected]",
        "mobile" => "011 8795",
        "phone" => "330 8738",
        "fax" => "566 5965",
        "tollFree" => "266 5698",
        "website" => "http://www.hermiston.com/architecto-commodi-possimus-esse-non-necessitatibus",
        "internalNotes" => "",
        "currency" => "USD",
        "address" => [
            "addressLine1" => "167 Iva Run",
            "addressLine2" => "Parker Mews, Monahanstad, 40778-7100",
            "city" => "West Tyrique",
            "postalCode" => "82271",
            "countryCode" => "EC",
       ],
       "shippingDetails" => [
            "name" => "Genevieve",
            "phone" => "011 8795",
            "instructions" => [
                "Delectus deleniti accusamus rerum voluptatem tempora.",
            ],
            "address" => [
                "addressLine1" => "167 Iva Run",
                "addressLine2" => "Parker Mews, Monahanstad, 40778-7100",
                "city" => "West Tyrique",
                "postalCode" => "82271",
                "countryCode" => "EC",
            ],
        ],
    ],
];

$newCustomer = $wave->customerCreate($customer);
bash
php artisan tinker
> (new \Jeffgreco13\Wave\Wave())->businesses()

php artisan wave:pull-currencies