diff --git a/README.md b/README.md index 60808c5..97a7b49 100644 --- a/README.md +++ b/README.md @@ -185,10 +185,10 @@ To create a file using the SDK, you need to have the file on disk: ```php // create a file from a local disk -$moltin->files->create(['public' => 'true'], '/path/to/file.jpg'); +$moltin->files->create(['public' => 'true', 'file' => '/path/to/file.jpg']); // create a file from a URL (note: this will download the file to your local disk then upload) -$moltin->files->create(['public' => 'true'], 'https://placeholdit.imgix.net/~text?&w=350&h=150'); +$moltin->files->create(['public' => 'true', 'file' => 'https://placeholdit.imgix.net/~text?&w=350&h=150']); ``` ### Integrations diff --git a/src/Resource.php b/src/Resource.php index aa6f786..ac8b29f 100644 --- a/src/Resource.php +++ b/src/Resource.php @@ -16,15 +16,16 @@ class Resource protected $relationshipTypeMap = [ 'brands' => 'brand', 'categories' => 'category', - 'children' => 'category', 'collections' => 'collection', + 'children' => 'category', 'files' => 'file', + 'main-image' => 'main_image', + 'options' => 'variation-option', 'parent' => 'category', 'products' => 'product', + 'product-modifiers' => 'product-modifier', 'variations' => 'variation', - 'variation-options' => 'variation-option', - 'options' => 'variation-option', - 'product-modifiers' => 'product-modifier' + 'variation-options' => 'variation-option' ]; // the \Moltin\Client