Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product & Product Variant Support #10

Merged
merged 3 commits into from
Jun 5, 2018
Merged

Product & Product Variant Support #10

merged 3 commits into from
Jun 5, 2018

Conversation

drwxmrrs
Copy link
Contributor

@drwxmrrs drwxmrrs commented Jun 5, 2018

This PR introduces a new Products and ProductVariants module into the SDK.

All of the BREAD methods are implemented for both the product and the product variant:

$product = $client->products()->read($id); // Get a product
$client->productVariants($product)->browse(); // Get all of the variants.

*/
public function getVariantsAttribute(array $variants)
{
return collect($variants)->mapInto(ProductVariant::class);
Copy link
Contributor

@dangreaves dangreaves Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about mapInto 👏

@dangreaves dangreaves self-requested a review June 5, 2018 06:20
Copy link
Contributor

@dangreaves dangreaves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome 🚀

@drwxmrrs drwxmrrs merged commit 2af8a5f into master Jun 5, 2018
@drwxmrrs drwxmrrs deleted the feature/products branch June 6, 2018 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants