Example usage of setting dependent objects properties without creating a new object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$payout = Factory::create() | |
->withPayment(function (PaymentContext $payment) { | |
$payment->amount = new Money(1337, new Currency('USD')); | |
}) | |
->payout(function (PayoutContext $payout) { | |
$payout->payoutId = PayoutId::fromString('03f74472-0e31-4d5c-8f61-bf34bda2dcb2'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment