Stop creating your Laravel invoices manually

Every Laravel E-commerce project requires processing payments and generating invoices. Yet for the best experience this flow needs to be tailored for each project.

Just to give you a few use cases:

Sometimes a successful payment is confirmed with an invoice receipt. That’s the simple use case.

And sometimes there is no payment (yet) but there still is an invoice. In this case the customer pays some time after receiving the service/product. Or it’s a correcting invoice accompanied by an outbound payment.

There are probably other use cases.

And what’s common for all of these?

All these use cases require an invoice generator.

So that’s why I have created laravel-invoicable. You can use it to create your tailored payment process. Together with laravel-payable-redirect-mollie for example (see previous post).

Using this package, you can:

  • create an invoice
  • add lines (items) to the invoice
  • add seller info to the invoice
  • add customer info to the invoice
  • add payment info to the invoice
  • calculate taxes and totals
  • generate a pdf of the invoice
  • handle discounts*
  • set the currency
  • set invoice status

* You can handle discounts by adding a line with a negative amount, or describe it in the line description field (“product x incl 30% discount”) and subtract the discount manually.

Ready to stop creating your Laravel invoices manually? Check out the github page for more information and code examples.

Create your first Laravel package

Laravel package development from scratch

Learning Laravel package development doesn't have to be hard. If you know how to create a basic Laravel app, you can write packages as well.

I've opened this course up for free to the first 100 subscribers only.

Join now and get the first lesson in your inbox right away.

We won't send you spam. Unsubscribe at any time. Powered by ConvertKit

4 Replies to “Stop creating your Laravel invoices manually”

  1. Thanks for this package as i am suffering from same issue =(

    as i need an invoice to be like receipt voucher which is really a big headache when i implement it .

    thanks for your effort and time

    thanks again brother ^^

  2. Hey there, I’m getting this error:

    Column ‘invoicable_id’ cannot be null (SQL: insert into `invoices` (`invoicable_id` …)

    I’ve set the Invoice to an order like this:
    $invoice = $order->invoices()->create([]);
    $invoice->invoicable_id = SOME_ID;
    $invoice = $invoice->addAmountInclTax(AMOUNT, ‘Some description’, 0);

    Any ideas? Do I have to define $invoice->invoicable_id ?

Leave a Reply

Your email address will not be published. Required fields are marked *