Laravel\Cashier\Invoice::rawTotal PHP Method

rawTotal() public method

Get the raw total amount that was paid (or will be paid).
public rawTotal ( ) : float
return float
    public function rawTotal()
    {
        return max(0, $this->transaction->amount);
    }

Usage Example

 /**
  * Create a local invoice for the given billable entity.
  *
  * @param  mixed  $billable
  * @param  \Laravel\Cashier\Invoice  $invoice
  * @return \Laravel\Spark\LocalInvoice
  */
 protected function createForBillable($billable, $invoice)
 {
     if ($existing = $billable->localInvoices()->where('provider_id', $invoice->id)->first()) {
         return $existing;
     }
     return $billable->localInvoices()->create(['provider_id' => $invoice->id, 'total' => $invoice->rawTotal() - $invoice->rawTotal() * $billable->taxPercentage(), 'tax' => $invoice->rawTotal() * $billable->taxPercentage(), 'card_country' => null, 'billing_state' => null, 'billing_zip' => null, 'billing_country' => null]);
 }
All Usage Examples Of Laravel\Cashier\Invoice::rawTotal