How samber/invoice-as-a-service works
Invoice as a service accepts JSON over HTTP, validates invoice and optional delivery settings, calculates totals, renders a PDF, then returns it directly or uploads it to configured destinations. The diagram follows the documented API route and the sampled controller and storage code. PDF internals and the template’s connection are not shown in excerpts, so that relationship is marked unverified; optional external delivery targets are documented in the README.
Main entry points: InvoiceController.php Invoice endpoint · Storage.php Upload handling · api.php API routes · PDF.php PDF builder
Components 15
HTTP request
- API routes
routes/api.php - Invoice endpoint
app/Http/Controllers/InvoiceController.php
Invoice processing
- Custom validation
app/Rules - PDF builder
app/Helpers/PDF.php - Invoice template
resources/views/invoices/default.blade.php
PDF delivery
- Upload handling
app/Helpers/Storage.php - S3 storage
- FTP server
- Webhook receiver
- Zapier hook
Laravel runtime
- HTTP entry
public/index.php - App bootstrap
bootstrap/app.php - HTTP kernel
app/Http/Kernel.php - Route provider
app/Providers/RouteServiceProvider.php
Other components
- API client
Connections 15
- API client → HTTP entry: sends request
- HTTP entry → App bootstrap: loads app
public/index.php - App bootstrap → HTTP kernel: binds kernel
bootstrap/app.php - HTTP kernel → Route provider: loads routing
- Route provider → API routes: registers API
app/Providers/RouteServiceProvider.php - API routes → Invoice endpoint: routes request
routes/api.php - Invoice endpoint → Custom validation: validates fields
app/Http/Controllers/InvoiceController.php - Invoice endpoint → PDF builder: builds PDF
app/Http/Controllers/InvoiceController.php - PDF builder → Invoice template: renders template
- Invoice endpoint → Upload handling: uploads PDF
app/Http/Controllers/InvoiceController.php - Upload handling → S3 storage: uploads PDF
- Upload handling → FTP server: uploads PDF
- Upload handling → Webhook receiver: posts PDF
- Upload handling → Zapier hook: posts PDF
- Invoice endpoint → API client: returns PDF or status
app/Http/Controllers/InvoiceController.php