Laravel\Cashier\Billable::invoices PHP Метод

invoices() публичный Метод

Get a collection of the entity's invoices.
public invoices ( boolean $includePending = false, array $parameters = [] ) : Collection
$includePending boolean
$parameters array
Результат Illuminate\Support\Collection
    public function invoices($includePending = false, $parameters = [])
    {
        $invoices = [];
        $customer = $this->asBraintreeCustomer();
        $parameters = array_merge(['id' => TransactionSearch::customerId()->is($customer->id), 'range' => TransactionSearch::createdAt()->between(Carbon::today()->subYears(2)->format('m/d/Y H:i'), Carbon::tomorrow()->format('m/d/Y H:i'))], $parameters);
        $transactions = BraintreeTransaction::search($parameters);
        // Here we will loop through the Braintree invoices and create our own custom Invoice
        // instance that gets more helper methods and is generally more convenient to work
        // work than the plain Braintree objects are. Then, we'll return the full array.
        if (!is_null($transactions)) {
            foreach ($transactions as $transaction) {
                if ($transaction->status == BraintreeTransaction::SETTLED || $includePending) {
                    $invoices[] = new Invoice($this, $transaction);
                }
            }
        }
        return new Collection($invoices);
    }