Skip to content

Commit

Permalink
Add getters for owner instances to objects
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Feb 27, 2020
1 parent e764158 commit a0d93c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ public function downloadAs($filename, array $data)
]);
}

/**
* Get the Stripe model instance.
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function owner()
{
return $this->owner;
}

/**
* Get the Stripe invoice instance.
*
Expand Down
10 changes: 10 additions & 0 deletions src/InvoiceItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ protected function formatAmount($amount)
return Cashier::formatAmount($amount, $this->item->currency);
}

/**
* Get the Stripe model instance.
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function owner()
{
return $this->owner;
}

/**
* Get the underlying Stripe invoice item.
*
Expand Down
10 changes: 10 additions & 0 deletions src/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ public function delete()
return $this->owner->removePaymentMethod($this->paymentMethod);
}

/**
* Get the Stripe model instance.
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function owner()
{
return $this->owner;
}

/**
* Get the Stripe PaymentMethod instance.
*
Expand Down

0 comments on commit a0d93c2

Please sign in to comment.