How laraveldaily/laravel-invoices works
Project type and purpose
• This is a Laravel-compatible Composer package, not a standalone app.
• Purpose: provide an easy, chainable API to generate invoice PDFs (stream, download, save) with support for templates, locales, taxes, discounts, etc.
File structure
• src/InvoiceServiceProvider.php: Laravel Service Provider that registers bindings, publishes config/views/translations, and registers Artisan commands (InstallCommand, UpdateCommand).
• src/Facades/Invoice.php: Facade alias for the main Invoice builder class.
• src/Invoice.php: Core “Invoice builder” class: methods to set seller, buyer, items, calculations.
• src/Classes (Buyer, Party, Seller, InvoiceItem): Data-model classes that implement PartyContract or define line items.
• src/Services/PricingService.php: Encapsulates tax, discount, subtotal, total calculations.
• src/Traits: Shared logic (date formatting, currency formatting, serial number, file saving, invoice helpers).
• resources/views/templates/*.blade.php: Blade templates used to render HTML for PDF conversion.
• config/invoices.php: Default configuration (dates, serial numbers, currency, paper, seller defaults).
• public/ & resources/: assets and published views/translations.
• tests/: PHPUnit tests for core functionality.
README for additional insights
• Usage examples show how the Facade → Invoice builder → set up Parties and Items → stream/download/save flows.
• It mentions publishing assets via Artisan (invoices:install, invoices:update) and underlying use of Laravel’s filesystem and view engine.
Essential detail
• Config file as a separate component that ServiceProvider reads.
• Translations directory feeding into Builder/Blade for localization.
• Traits as attached to the Invoice Builder or PricingService.
• Where customization occurs (template selection, overrides via publish).