|
1 | | -# laravel-invoicelite |
2 | | -💸 Laravel-InvoiceLite — Advanced, multi-country 🌍, multi-language 🗣️ & multi-template 🎨 invoice generator for Laravel 10+ ⚙️. Generate, export (PDF 📄/Image 🖼️), share 🔗, email 📧, and auto-convert currencies 💱 — lightning-fast ⚡, developer-friendly 💻 & 100 % customizable 🚀 |
| 1 | +# Laravel InvoiceLite 🧾 |
| 2 | + |
| 3 | +💼 **Laravel InvoiceLite** — Multi-language, multi-country, professional invoice generator with PDF/Image export, templates, taxes & sharing 🚀 |
| 4 | + |
| 5 | +[](https://packagist.org/packages/subhashladumor1/laravel-invoicelite) |
| 6 | +[](https://packagist.org/packages/subhashladumor1/laravel-invoicelite) |
| 7 | +[](https://github.com/subhashladumor1/laravel-invoicelite/blob/main/LICENSE) |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## 🎯 Introduction |
| 12 | + |
| 13 | +**Laravel InvoiceLite** is a modern, advanced, multi-language 🌍, multi-country 🌎 invoice generator for Laravel applications. It allows developers to quickly generate, customize, export, share, and email invoices with support for multiple countries, languages, and templates. |
| 14 | + |
| 15 | +This package is built for Laravel 10+ and provides a clean, developer-friendly API to generate professional invoices with minimal setup. |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## ⚡ Features |
| 20 | + |
| 21 | +- 🧮 **Dynamic Invoice Generation** - From arrays, models, or JSON data |
| 22 | +- 🌍 **Multi-language Support** - English, French, German, Hindi and more |
| 23 | +- 🌐 **Multi-country Tax Systems** - GST, VAT, Sales Tax, etc. |
| 24 | +- 🧱 **Pre-built Templates** - Modern, Classic, Minimal designs |
| 25 | +- 💾 **Multiple Export Formats** - PDF, Image (PNG/JPEG), HTML |
| 26 | +- 📤 **Shareable Links** - Unique signed URLs for invoice sharing |
| 27 | +- 🎨 **Custom Branding** - Logo, color, header/footer customization |
| 28 | +- 💬 **Localized Templates** - Multi-language using JSON translations |
| 29 | +- 💡 **Developer-Friendly** - Single function helper for quick generation |
| 30 | +- ⚙️ **Performance Optimized** - Caching and optimization built-in |
| 31 | +- 🧑💻 **Well Documented** - Comprehensive examples and documentation |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## 🧩 Installation |
| 36 | + |
| 37 | +You can install the package via composer: |
| 38 | + |
| 39 | +```bash |
| 40 | +composer require subhashladumor1/laravel-invoicelite |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## ⚙️ Publish Configuration |
| 46 | + |
| 47 | +Publish the configuration file to customize the package behavior: |
| 48 | + |
| 49 | +```bash |
| 50 | +php artisan vendor:publish --tag=invoicelite-config |
| 51 | +``` |
| 52 | + |
| 53 | +Publish language files for customization: |
| 54 | + |
| 55 | +```bash |
| 56 | +php artisan vendor:publish --tag=invoicelite-lang |
| 57 | +``` |
| 58 | + |
| 59 | +Publish template files for customization: |
| 60 | + |
| 61 | +```bash |
| 62 | +php artisan vendor:publish --tag=invoicelite-templates |
| 63 | +``` |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## 🧾 Usage Example |
| 68 | + |
| 69 | +```php |
| 70 | +use SubhashLadumor1\InvoiceLite\Facades\InvoiceLite; |
| 71 | + |
| 72 | +$data = [ |
| 73 | + 'invoice_no' => 'INV-2025-001', |
| 74 | + 'customer' => ['name' => 'John Doe', 'email' => 'john@example.com'], |
| 75 | + 'items' => [ |
| 76 | + ['name' => 'Web Development', 'price' => 1200, 'qty' => 1], |
| 77 | + ['name' => 'Hosting', 'price' => 100, 'qty' => 12], |
| 78 | + ], |
| 79 | + 'tax' => 18, |
| 80 | + 'currency' => 'INR', |
| 81 | + 'language' => 'en' |
| 82 | +]; |
| 83 | + |
| 84 | +InvoiceLite::make($data) |
| 85 | + ->template('modern') |
| 86 | + ->currency('INR') |
| 87 | + ->export('pdf') |
| 88 | + ->save(storage_path('invoices/invoice.pdf')); |
| 89 | +``` |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## 🌐 Multi-language Example |
| 94 | + |
| 95 | +```php |
| 96 | +InvoiceLite::make($data) |
| 97 | + ->language('fr') // French |
| 98 | + ->template('modern') |
| 99 | + ->export('pdf') |
| 100 | + ->save(storage_path('invoices/invoice-fr.pdf')); |
| 101 | +``` |
| 102 | + |
| 103 | +Supported languages: |
| 104 | +- English (`en`) |
| 105 | +- French (`fr`) |
| 106 | +- German (`de`) |
| 107 | +- Hindi (`hi`) |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## 🌎 Multi-country Tax Example |
| 112 | + |
| 113 | +```php |
| 114 | +$taxCalculator = new \SubhashLadumor1\InvoiceLite\Services\TaxCalculator(); |
| 115 | + |
| 116 | +// Get tax rules for India |
| 117 | +$indiaTax = $taxCalculator->getCountryTaxRules('IN'); // ['name' => 'GST', 'rate' => 18.0] |
| 118 | + |
| 119 | +// Get tax rules for United States |
| 120 | +$usTax = $taxCalculator->getCountryTaxRules('US'); // ['name' => 'Sales Tax', 'rate' => 7.5] |
| 121 | + |
| 122 | +// Use in invoice generation |
| 123 | +InvoiceLite::make($data) |
| 124 | + ->template('modern') |
| 125 | + ->export('pdf') |
| 126 | + ->save(storage_path('invoices/invoice-with-tax.pdf')); |
| 127 | +``` |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## 🎨 Template Customization Guide |
| 132 | + |
| 133 | +The package comes with three built-in templates: |
| 134 | +1. **Modern** - Clean, gradient design with modern aesthetics |
| 135 | +2. **Classic** - Traditional invoice layout with borders |
| 136 | +3. **Minimal** - Simple, minimalist design |
| 137 | + |
| 138 | +To customize templates: |
| 139 | +1. Publish the templates: |
| 140 | + ```bash |
| 141 | + php artisan vendor:publish --tag=invoicelite-templates |
| 142 | + ``` |
| 143 | +2. Edit the templates in `resources/views/vendor/invoicelite/` |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +## 📤 Invoice Share Link Example |
| 148 | + |
| 149 | +Generate a shareable link for an invoice: |
| 150 | + |
| 151 | +```php |
| 152 | +$link = InvoiceLite::generateShareLink('INV-2025-001', now()->addDays(7)); // Expires in 7 days |
| 153 | + |
| 154 | +// Or use default expiration (30 days) |
| 155 | +$link = InvoiceLite::generateShareLink('INV-2025-001'); |
| 156 | +``` |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +## ⚙️ Configuration Options |
| 161 | + |
| 162 | +The configuration file allows you to customize: |
| 163 | + |
| 164 | +```php |
| 165 | +return [ |
| 166 | + 'default_template' => 'modern', |
| 167 | + 'default_currency' => 'USD', |
| 168 | + 'default_language' => 'en', |
| 169 | + 'supported_currencies' => ['USD', 'EUR', 'GBP', 'INR', 'JPY', 'CAD', 'AUD', 'CHF', 'CNY', 'SEK'], |
| 170 | + 'supported_languages' => ['en', 'fr', 'de', 'hi'], |
| 171 | + 'supported_templates' => ['modern', 'classic', 'minimal'], |
| 172 | + 'company' => [ |
| 173 | + 'name' => 'Your Company Name', |
| 174 | + 'address' => '123 Main Street, City, Country', |
| 175 | + 'email' => 'info@yourcompany.com', |
| 176 | + 'phone' => '+1 234 567 8900', |
| 177 | + 'website' => 'https://yourcompany.com', |
| 178 | + 'logo' => '', // Path to your logo |
| 179 | + ], |
| 180 | + // ... more options |
| 181 | +]; |
| 182 | +``` |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +## 🧩 Contributing |
| 187 | + |
| 188 | +Contributions are welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
| 189 | + |
| 190 | +--- |
| 191 | + |
| 192 | +## 🪪 License |
| 193 | + |
| 194 | +The MIT License (MIT). Please see [License File](LICENSE) for more information. |
| 195 | + |
| 196 | +--- |
| 197 | + |
| 198 | +## 🙏 Acknowledgements |
| 199 | + |
| 200 | +- [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf) - For PDF generation |
| 201 | +- [intervention/image](https://github.com/Intervention/image) - For image processing |
| 202 | +- All contributors who have helped shape this package |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## 📧 Contact |
| 207 | + |
| 208 | +For support or feature requests, please [open an issue](https://github.com/subhashladumor1/laravel-invoicelite/issues) on GitHub. |
0 commit comments