diff --git a/README.md b/README.md index a44ad50..be1abee 100644 --- a/README.md +++ b/README.md @@ -10,124 +10,7 @@ ## Usage -### Initialize Client - -```php -use Eightfold\Printify\Client; -use Eightfold\Printify\Printify; - -$client = Client::connect( - Printify::account({'your Printify access token'}) -); -``` - -### Use Client - -The Client is the recommended entry point and leverages a fluent approach. - -**Retrieve a list of shops in a Printify account** - -```php -// API call -$client->getShops(); -``` - -*Retrieve a single shop (from the list of shops)* - -```php -// API call -$client->getShop({shop id}); -``` - -*Retrieve a Shop instance (supports lazy loading)* - -```php -// No API call -$shop = $client->shop({shop id}); - -$shop->id(); - -// API call -$shop->title(); -``` - -**Retrieve a list of products in a Shop** - -```php -// API call -$client->getProducts($shop); -``` - -*Retrieve a single Product* - -```php -// API call -$client->getProduct({product id}); -``` - -*Retrieve a Product instance (supports lazy loading)* - -```php -// No API call -$product = $client->getProduct($shop, {product id}); - -$product->id(); - -$product->shopId(); - -// API call -$product->title(); - -$product->description(); - -// and other properties -``` - -*Retrieve a collection of Variants for a Product* - -```php -// API call -$variants = $product->variants(); -``` - -*Retrieve a single Variant from a Product* - -```php -// API call -$variant = $product->variants()->atIndex(0); - -$variant = $product->variants()->variantWithId({variant id}); -``` - -*Retrieve a collection of Images for a Product* - -```php -$images = $product->images(); -``` - -*Retrieve array of Images for a Variant* - -```php -$images = $variant->images($product); - -$images = $product->imagesForVariant($variant); -``` - -*Retrieve default Image for a Variant* - -```php -$image = $variant->defaultImage($product); - -$image = $product->defaultForVariant($variant); - -$image = $product->imagesForVariant($variant, defaultOnly: true); -``` - -**Set Product publish status to succeeded** - -```php -$client->postPublishingSucceededForProduct($product); -``` +Still in progress. See tests for now. ## Details