- What Laravel versions does laravel-invoices support?
- The package is designed for Laravel 11 and 12 only. If you're using Laravel 9 or earlier, you’ll need to upgrade or check for legacy branches, though official support is dropped. PHP 8.2+ is also required.
- How do I install and set up laravel-invoices in my project?
- Run `composer require laraveldaily/laravel-invoices:^4.1.1` to install, then execute `php artisan invoices:install` to publish assets, views, translations, and config. No database migrations are required for basic usage.
- Can I customize the invoice PDF template to match my brand?
- Yes, the package uses Blade templates stored in `resources/views/vendor/invoices/templates/`. Override the default template by copying it to your project’s views folder and modifying it. Familiarity with Blade syntax and PDF layout constraints is recommended.
- Does laravel-invoices support multi-currency invoices?
- Yes, the package includes built-in currency formatting. You can configure default currency in `config/invoices.php` and override it per invoice using `setCurrency()`. Taxes and totals will adjust automatically based on the selected currency.
- How do I handle taxes and discounts in laravel-invoices?
- Taxes and discounts can be applied per item (fixed or percentage-based) or to the entire invoice. Use methods like `addTax()`, `addDiscount()`, or `setTaxRate()` when building your invoice object. The package calculates totals automatically.
- Can I store invoices in cloud storage like S3?
- Absolutely. The package leverages Laravel’s filesystem drivers, so you can save invoices to any configured disk (local, S3, etc.) using `invoice->save($diskName)`. Ensure your storage driver is properly configured in `config/filesystems.php`.
- What PDF rendering engines does laravel-invoices support?
- By default, it uses DomPDF. For more advanced rendering, install the `barryvdh/laravel-snappy` package and configure it in `config/invoices.php`. Snappy requires Ghostscript, which may add deployment complexity.
- How do I generate invoices asynchronously for large-scale systems?
- The package doesn’t natively support async generation, but you can queue the invoice creation process using Laravel Queues. Trigger the job from your controller and use `invoice->save()` or `invoice->stream()` within the job to generate the PDF.
- Are there any GDPR or data privacy concerns with invoice PDFs?
- Since invoices may contain sensitive data (e.g., customer addresses), ensure compliance with GDPR or other regulations. Avoid storing unnecessary personal data in PDFs, and consider encrypting or securing stored invoices on disk or cloud storage.
- What alternatives exist if laravel-invoices doesn’t fit my needs?
- Consider packages like `spatie/pdf-to-base64` for simpler PDF generation, `barryvdh/laravel-dompdf` for direct DomPDF integration, or `spatie/laravel-invoice` for a more feature-rich alternative with invoice numbering and emailing capabilities.