Skip to content

Commit

Permalink
Added expand option to Subscription latestInvoice() (#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumwebco authored Jul 6, 2023
1 parent 93a04e0 commit 060f03d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 060f03d

Please sign in to comment.