Skip to content

Commit 9ec5e73

Browse files
Merge pull request #4 from subhashladumor1/dev
add QR code, signature and fix bug
2 parents 86e2242 + ddf0046 commit 9ec5e73

File tree

15 files changed

+1414
-175
lines changed

15 files changed

+1414
-175
lines changed

README.md

Lines changed: 87 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This package is built for Laravel 10+ and provides a clean, developer-friendly A
2121
- 🧮 **Dynamic Invoice Generation** - From arrays, models, or JSON data
2222
- 🌍 **Multi-language Support** - 30+ popular languages out of the box
2323
- 🌐 **Multi-country Tax Systems** - GST, VAT, Sales Tax, etc.
24-
- 🧱 **Pre-built Templates** - Modern, Classic, Minimal designs
24+
- 🧱 **Pre-built Templates** - Modern, Classic, Minimal, Business, Corporate designs
2525
- 💾 **Multiple Export Formats** - PDF, Image (PNG/JPEG), HTML
2626
- 📤 **Shareable Links** - Unique signed URLs for invoice sharing
2727
- 🎨 **Custom Branding** - Logo, color, header/footer customization
@@ -32,6 +32,9 @@ This package is built for Laravel 10+ and provides a clean, developer-friendly A
3232
- 📧 **Email Integration** - Send invoices directly via email
3333
- 💱 **Automatic Currency Conversion** - Real-time currency conversion
3434
- 🚀 **Fully Customizable** - Extensible and configurable
35+
- 📱 **QR Code Generation** - Automatic QR code for invoice verification
36+
- ✍️ **Digital Signatures** - Add digital signatures to invoices
37+
- 🖼️ **Professional Templates** - Based on modern design principles
3538

3639
---
3740

@@ -90,11 +93,12 @@ $data = [
9093
'currency' => 'USD',
9194
'language' => 'en',
9295
'notes' => 'Thank you for your business. Payment is due within 30 days.',
93-
'terms' => 'Please make checks payable to Your Company Name. Late payments are subject to a 1.5% monthly finance charge.'
96+
'terms' => 'Please make checks payable to Your Company Name. Late payments are subject to a 1.5% monthly finance charge.',
97+
'signature' => 'https://example.com/signature.png' // Optional digital signature
9498
];
9599

96100
InvoiceLite::make($data)
97-
->template('modern')
101+
->template('business') // Try our new professional business template!
98102
->currency('USD')
99103
->export('pdf')
100104
->save(storage_path('invoices/invoice.pdf'));
@@ -132,14 +136,14 @@ Laravel InvoiceLite supports 30+ popular languages out of the box:
132136
// Generate invoice in Spanish
133137
InvoiceLite::make($data)
134138
->language('es')
135-
->template('modern')
139+
->template('business')
136140
->export('pdf')
137141
->save(storage_path('invoices/invoice-es.pdf'));
138142

139143
// Generate invoice in Japanese
140144
InvoiceLite::make($data)
141145
->language('ja')
142-
->template('modern')
146+
->template('corporate')
143147
->export('pdf')
144148
->save(storage_path('invoices/invoice-ja.pdf'));
145149

@@ -153,6 +157,64 @@ InvoiceLite::make($data)
153157

154158
---
155159

160+
## 🎨 Professional Templates
161+
162+
We now offer 5 professional templates:
163+
164+
1. **Modern** - Clean, gradient design with modern aesthetics
165+
2. **Classic** - Traditional invoice layout with borders
166+
3. **Minimal** - Simple, minimalist design
167+
4. **Business** - Professional business template with QR code
168+
5. **Corporate** - Corporate-style template with branding options
169+
170+
### Template Preview
171+
172+
![Business Template](https://cdn.dribbble.com/userupload/22459797/file/original-ddcc7a7a689a009160d8d5d03385b428.png?resize=752x564&vertical=center)
173+
*Business Template*
174+
175+
![Corporate Template](https://cdn.dribbble.com/userupload/16092429/file/original-6c252a9a0e3dc275213c1b2a8327fb90.png?resize=752x&vertical=center)
176+
*Corporate Template*
177+
178+
![Modern Template](https://cdn.dribbble.com/userupload/10162802/file/original-ff594ddaf5218e3ca23f64cf64f36b87.png?resize=752x&vertical=center)
179+
*Modern Template*
180+
181+
![Classic Template](https://cdn.dribbble.com/userupload/17147152/file/original-c92136048f132531a06c921b6be0801b.jpg?resize=752x&vertical=center)
182+
*Classic Template*
183+
184+
---
185+
186+
## 📱 QR Code Generation
187+
188+
All invoices automatically include a QR code for easy verification:
189+
190+
```php
191+
// QR code is automatically generated
192+
InvoiceLite::make($data)
193+
->template('business')
194+
->export('pdf')
195+
->save(storage_path('invoices/invoice-with-qr.pdf'));
196+
```
197+
198+
---
199+
200+
## ✍️ Digital Signatures
201+
202+
Add digital signatures to your invoices:
203+
204+
```php
205+
$data = [
206+
// ... other data
207+
'signature' => 'https://yourcompany.com/signature.png'
208+
];
209+
210+
InvoiceLite::make($data)
211+
->template('business')
212+
->export('pdf')
213+
->save(storage_path('invoices/invoice-with-signature.pdf'));
214+
```
215+
216+
---
217+
156218
## 🌎 Multi-country Tax Support
157219

158220
Support for country-specific tax systems:
@@ -170,7 +232,7 @@ $australiaTax = $taxCalculator->getCountryTaxRules('AU'); // Australia - GST (10
170232

171233
// Use country-specific tax in invoice generation
172234
InvoiceLite::make($data)
173-
->template('modern')
235+
->template('corporate')
174236
->export('pdf')
175237
->save(storage_path('invoices/invoice-with-uk-tax.pdf'));
176238
```
@@ -182,15 +244,15 @@ InvoiceLite::make($data)
182244
### PDF Export (Default)
183245
```php
184246
InvoiceLite::make($data)
185-
->template('modern')
247+
->template('business')
186248
->export('pdf')
187249
->save(storage_path('invoices/invoice.pdf'));
188250
```
189251

190252
### HTML Export
191253
```php
192254
InvoiceLite::make($data)
193-
->template('modern')
255+
->template('business')
194256
->export('html')
195257
->save(storage_path('invoices/invoice.html'));
196258
```
@@ -199,13 +261,13 @@ InvoiceLite::make($data)
199261
```php
200262
// PNG export
201263
InvoiceLite::make($data)
202-
->template('modern')
264+
->template('business')
203265
->export('png')
204266
->save(storage_path('invoices/invoice.png'));
205267

206268
// JPEG export
207269
InvoiceLite::make($data)
208-
->template('modern')
270+
->template('business')
209271
->export('jpeg')
210272
->save(storage_path('invoices/invoice.jpeg'));
211273
```
@@ -232,37 +294,6 @@ $link = InvoiceLite::generateShareLink('INV-2025-001', now()->addMonths(3)); //
232294

233295
---
234296

235-
## 🎨 Template Customization
236-
237-
The package comes with three built-in templates:
238-
239-
1. **Modern** - Clean, gradient design with modern aesthetics
240-
2. **Classic** - Traditional invoice layout with borders
241-
3. **Minimal** - Simple, minimalist design
242-
243-
### Customizing Templates
244-
245-
1. Publish the templates:
246-
```bash
247-
php artisan vendor:publish --tag=invoicelite-templates
248-
```
249-
250-
2. Edit the templates in `resources/views/vendor/invoicelite/`
251-
252-
3. Create your own custom templates by copying and modifying existing ones
253-
254-
### Using Custom Templates
255-
256-
```php
257-
// Use a custom template
258-
InvoiceLite::make($data)
259-
->template('custom-corporate')
260-
->export('pdf')
261-
->save(storage_path('invoices/custom-invoice.pdf'));
262-
```
263-
264-
---
265-
266297
## 💱 Currency Support
267298

268299
Support for 20+ international currencies:
@@ -332,7 +363,7 @@ $invoices = [
332363

333364
foreach ($invoices as $invoiceData) {
334365
InvoiceLite::make($invoiceData)
335-
->template('modern')
366+
->template('business')
336367
->export('pdf')
337368
->save(storage_path("invoices/{$invoiceData['invoice_no']}.pdf"));
338369
}
@@ -347,7 +378,7 @@ use SubhashLadumor1\InvoiceLite\Facades\InvoiceLite;
347378
// Generate invoice
348379
$invoicePath = storage_path('invoices/invoice.pdf');
349380
InvoiceLite::make($data)
350-
->template('modern')
381+
->template('business')
351382
->export('pdf')
352383
->save($invoicePath);
353384

@@ -367,7 +398,7 @@ The configuration file allows extensive customization:
367398

368399
```php
369400
return [
370-
'default_template' => 'modern',
401+
'default_template' => 'business',
371402
'default_currency' => 'USD',
372403
'default_language' => 'en',
373404
'supported_currencies' => [
@@ -380,7 +411,7 @@ return [
380411
'hu', 'ro', 'bg', 'el', 'th', 'vi', 'id', 'ms', 'he', 'uk',
381412
'sk', 'hr', 'lt', 'lv'
382413
],
383-
'supported_templates' => ['modern', 'classic', 'minimal'],
414+
'supported_templates' => ['modern', 'classic', 'minimal', 'business', 'corporate'],
384415
'company' => [
385416
'name' => 'Your Company Name',
386417
'address' => '123 Main Street, City, Country',
@@ -402,6 +433,15 @@ return [
402433
'expire_days' => 30,
403434
'route_prefix' => 'invoice',
404435
],
436+
'qr_code' => [
437+
'enabled' => true,
438+
'size' => 100,
439+
'format' => 'png',
440+
],
441+
'signature' => [
442+
'enabled' => false,
443+
'path' => '', // Path to signature image
444+
],
405445
];
406446
```
407447

@@ -413,7 +453,7 @@ The package provides several helpful global functions:
413453

414454
```php
415455
// Generate an invoice using the helper
416-
invoice_lite()->make($data)->template('modern')->export('pdf')->save($path);
456+
invoice_lite()->make($data)->template('business')->export('pdf')->save($path);
417457

418458
// Format currency
419459
echo format_currency(1234.56, 'USD'); // $1,234.56
@@ -452,6 +492,7 @@ The MIT License (MIT). Please see [License File](LICENSE) for more information.
452492

453493
- [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf) - For PDF generation
454494
- [intervention/image](https://github.com/Intervention/image) - For image processing
495+
- [simplesoftwareio/simple-qrcode](https://github.com/SimpleSoftwareIO/simple-qrcode) - For QR code generation
455496
- All contributors who have helped shape this package
456497

457498
---

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "💼 Laravel InvoiceLite — Multi-language, multi-country, professional invoice generator with PDF/Image export, templates, taxes & sharing 🚀",
44
"type": "library",
55
"license": "MIT",
6-
"version": "1.0.2",
6+
"version": "1.0.3",
77
"keywords": [
88
"laravel invoice",
99
"invoice generator",
@@ -66,6 +66,7 @@
6666
"illuminate/cache": "^9.0|^10.0|^11.0|^12.0",
6767
"illuminate/session": "^9.0|^10.0|^11.0|^12.0",
6868
"illuminate/database": "^9.0|^10.0|^11.0|^12.0",
69-
"illuminate/view": "^9.0|^10.0|^11.0|^12.0"
69+
"illuminate/view": "^9.0|^10.0|^11.0|^12.0",
70+
"simplesoftwareio/simple-qrcode": "^4.2"
7071
}
7172
}

src/Config/invoicelite.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
|
7373
*/
7474
'supported_templates' => [
75-
'modern', 'classic', 'minimal'
75+
'modern', 'classic', 'minimal', 'business', 'corporate'
7676
],
7777

7878
/*
@@ -131,4 +131,31 @@
131131
'expire_days' => 30,
132132
'route_prefix' => 'invoice',
133133
],
134+
135+
/*
136+
|--------------------------------------------------------------------------
137+
| QR Code Settings
138+
|--------------------------------------------------------------------------
139+
|
140+
| Configure QR code generation for invoices.
141+
|
142+
*/
143+
'qr_code' => [
144+
'enabled' => true,
145+
'size' => 100,
146+
'format' => 'png',
147+
],
148+
149+
/*
150+
|--------------------------------------------------------------------------
151+
| Signature Settings
152+
|--------------------------------------------------------------------------
153+
|
154+
| Configure digital signature settings for invoices.
155+
|
156+
*/
157+
'signature' => [
158+
'enabled' => false,
159+
'path' => '', // Path to signature image
160+
],
134161
];

src/Lang/de/invoice.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@
2727
'invoice_total' => 'Rechnungsbetrag',
2828
'thank_you' => 'Vielen Dank für Ihr Geschäft!',
2929
'footer_note' => 'Dies ist eine automatisch generierte Rechnung. Keine Unterschrift erforderlich.',
30+
'website' => 'Webseite',
31+
'phone' => 'Telefon',
32+
'address' => 'Adresse',
33+
'signature' => 'Unterschrift',
34+
'invoice_qr' => 'Rechnungs-QR-Code',
3035
];

src/Lang/en/invoice.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@
2727
'invoice_total' => 'Invoice Total',
2828
'thank_you' => 'Thank you for your business!',
2929
'footer_note' => 'This is an auto-generated invoice. No signature required.',
30+
'website' => 'Website',
31+
'phone' => 'Phone',
32+
'address' => 'Address',
33+
'signature' => 'Signature',
34+
'invoice_qr' => 'Invoice QR Code',
3035
];

src/Lang/es/invoice.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@
2727
'invoice_total' => 'Total factura',
2828
'thank_you' => '¡Gracias por su negocio!',
2929
'footer_note' => 'Esta es una factura generada automáticamente. No se requiere firma.',
30+
'website' => 'Sitio Web',
31+
'phone' => 'Teléfono',
32+
'address' => 'Dirección',
33+
'signature' => 'Firma',
34+
'invoice_qr' => 'Código QR de factura',
3035
];

src/Lang/fr/invoice.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@
2727
'invoice_total' => 'Total de la facture',
2828
'thank_you' => 'Merci pour votre entreprise !',
2929
'footer_note' => 'Ceci est une facture auto-générée. Aucune signature requise.',
30+
'website' => 'Site Web',
31+
'phone' => 'Téléphone',
32+
'address' => 'Adresse',
33+
'signature' => 'Signature',
34+
'invoice_qr' => 'Code QR de la facture',
3035
];

src/Providers/InvoiceLiteServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ public function register(): void
5353
__DIR__.'/../Config/invoicelite.php', 'invoicelite'
5454
);
5555

56+
// Register QR Code service provider if it exists
57+
if (class_exists('\SimpleSoftwareIO\QrCode\QrCodeServiceProvider')) {
58+
$this->app->register(\SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class);
59+
}
60+
5661
// Bind contracts to implementations
5762
$this->app->bind(InvoiceGeneratorInterface::class, InvoiceManager::class);
5863

0 commit comments

Comments
 (0)