PHP code example of wndrfl / pizzaboy

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

    

wndrfl / pizzaboy example snippets


$user = $pizzaboy->login(<email>,<password>);

$order = $user->newOrder();

$order
	->newPizza('medium','hand-tossed')
	->setCheese('whole','normal')
	->setSauce('tomato','normal')
	->addPepperoni()
	->addPineapple()
	->save();

$order
	->address()
	->setStreet($_POST['street'])
	->setCity($_POST['city'])
	->setRegion($_POST['state'])
	->setPostalCode($_POST['postal_code'])
	->save();

if($order->place()) {
	echo "Order placed!";
}else{
	echo "Order was not placed.";
}