PHP code example of wingly / pwinty

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

    

wingly / pwinty example snippets


use Wingly\Pwinty\Orderer;

class User extends Authenticatable
{
    use Orderer;
}

$user = User::first();

$user->newOrder()
    ->setRecipientName('John Doe')
    ->setCountryCode('FR')
    ->create();

$order = Order::first();

$order->addImage(
    'ART-PRI-HPG-20X28-PRODIGI_GB', 
    'https://testserver.com/aphoto.jpg'
);
 
$order = Order::first();

$order->submit();

$order->fresh()->submitted(); // true
 
$order = Order::first();

$order->cancel();

$order->fresh()->cancelled(); // true
 
$order = Order::first();

$pwintyOrder = $order->updatePwintyOrder(['recipientName' => 'John Doe']);

$order = Order::first();

$pwintyOrder = $order->asPwintyOrder();
 
class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'pwinty/*'
    ];
}
 bash
php artisan migrate
bash
php artisan pwinty:sign