From ac349691eb828df1d46c313151ebecd340cb7111 Mon Sep 17 00:00:00 2001 From: Rusty Date: Tue, 4 Jul 2023 12:48:39 +0000 Subject: [PATCH] Added expand option to Subscription latestInvoice() --- src/Subscription.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Subscription.php b/src/Subscription.php index 222f8486..c5c6d084 100644 --- a/src/Subscription.php +++ b/src/Subscription.php @@ -1139,9 +1139,9 @@ public function invoice(array $options = []) * * @return \Laravel\Cashier\Invoice|null */ - public function latestInvoice() + public function latestInvoice(array $expand = []) { - $stripeSubscription = $this->asStripeSubscription(['latest_invoice']); + $stripeSubscription = $this->asStripeSubscription(['latest_invoice', ...$expand]); if ($stripeSubscription->latest_invoice) { return new Invoice($this->owner, $stripeSubscription->latest_invoice);