LaravelDaily / laravel-invoices

Laravel package to generate PDF invoices from various customizable parameters
GNU General Public License v3.0
1.39k stars 303 forks source link

Adding Custom Data To An Invoice Item #159

Closed omarchouman closed 2 years ago

omarchouman commented 2 years ago

Greetings,

First of all, I am really impressed with this package and all of the effort that has been put into building this.

I have a small inquiry, please.

Can I add my own custom data to an invoice item other than the ones mentioned in the documentation?

For example, I don't want a description, quantity, price per unit, and so on.

I want my custom data like service, sub_service, and these types of stuff.

I tried to do my custom items in invoice.php using methods. Yet, I couldn't manage to display that data.

I would be grateful if you were able to assist me with that.

Thank you, Omar

mc0de commented 2 years ago

@omarchouman hi

see #154 it was described about custom templates #30

mc0de commented 2 years ago

@omarchouman

you can create your own class

class MyInvoice extends Invoice {
}

and add your custom methods with whatever you want