PHP code example of simplesquid / laravel-vend-sdk

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

    

simplesquid / laravel-vend-sdk example snippets


use SimpleSquid\LaravelVend\Facades\Vend;
use SimpleSquid\LaravelVend\Jobs\VendRequestJob;

/* Get the list of products. */
public function getProducts() {

    return VendRequestJob::dispatchNow(function () {
        return Vend::product()->get();
    });

}

/* Create a new product. */
public function createProduct($product) {

    VendRequestJob::dispatch(function () use $product {
        return Vend::product()->create($product);
    });

}
bash
php artisan vendor:publish --provider="SimpleSquid\LaravelVend\VendServiceProvider"