Download the PHP package sharpapi/laravel-invoice-manager without Composer
On this page you can find all versions of the php package sharpapi/laravel-invoice-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sharpapi/laravel-invoice-manager
More information about sharpapi/laravel-invoice-manager
Files in sharpapi/laravel-invoice-manager
Package laravel-invoice-manager
Short Description AI-powered Invoice Manager for Laravel. Parse invoices with SharpAPI, store every extracted field in your database, and manage them with ready-made Laravel Nova resources.
License MIT
Homepage https://github.com/sharpapi/laravel-invoice-manager
Informations about the package laravel-invoice-manager

Invoice Manager for Laravel: AI Invoice Parsing, Database and Nova Admin (powered by SharpAPI)
Turn any invoice (PDF, scan, or photo) into clean, queryable database rows and a ready-made admin UI, with one command.
laravel-invoice-manager is the batteries-included layer on top of the SharpAPI Invoice Parser. The SharpAPI endpoint reads an invoice and returns 100+ structured fields. This package takes that result and does the part you would otherwise build by hand: a battle-tested database schema, Eloquent models, an idempotent importer, a queued job, an artisan command, and optional Laravel Nova resources.
You run one command. You get a fully populated invoices table with line items, tax details, seller and buyer parties, bank details, and the complete raw payload, all related and ready to query.
Architecture at a glance
This package owns the blue boxes: the import command and job, the InvoiceImporter, the InvoiceImported event, and the optional Nova admin. The parsing itself is delegated to sharpapi/laravel-invoice-parser, which calls the SharpAPI endpoint. See Data model for the full schema.
Why this exists (the value)
Manual invoice processing costs businesses an average of $15 to $40 per invoice once you add up labor, errors, and delays. It is the single biggest source of accounts payable mistakes. The SharpAPI Invoice Parser takes that from minutes per invoice to seconds and removes manual data entry entirely.
But the parser hands you JSON. To actually use it you still need a schema, models, a mapper that handles missing fields and empty strings, idempotency so retries do not duplicate rows, and an admin screen so your team can see what came in. That is days to weeks of work, and it is the same work for every project.
This package is that work, done once, the right way:
- Dream outcome: every field from any invoice, in your own database, queryable with Eloquent, visible in a Nova admin, feeding your ERP or reconciliation pipeline.
- Proven and reliable: a normalized schema, an importer wrapped in a transaction, idempotent imports keyed on the SharpAPI job id, and a Pest test suite that runs with zero network calls.
- Near-zero time delay:
composer require,php artisan migrate, thenphp artisan invoice-manager:import invoice.pdf --sync. Rows appear. - Near-zero effort: no OCR to train, no parsing rules to maintain, no schema to design, no edge cases to chase. The AI does extraction, this package does persistence.
If you process invoices in Laravel, this is the shortest path from a file on disk to structured, managed data.
Key Features
- One-command import:
invoice-manager:import {path}parses with SharpAPI and stores everything. - Complete schema: invoices, parties (seller and buyer), bank details, line items, and tax details, with frequently-queried values as real columns and rarely-queried groups as JSON.
- Idempotent imports: re-running the same SharpAPI job never creates duplicate rows (configurable: update, skip, or always new).
- Queued processing: dispatch
ParseAndStoreInvoiceJobto handle invoices in the background and at scale. - Optional Laravel Nova admin: ready-made resources that activate automatically when Nova is installed, and stay out of the way when it is not.
- Clean data guarantees: empty strings become
null, dates become realdatecolumns, money isdecimal(15,2). - Fully configurable and publishable: table prefix, model classes, queue, and Nova behaviour are all config-driven.
How it relates to laravel-invoice-parser
This package builds on top of sharpapi/laravel-invoice-parser, the thin SDK that calls the SharpAPI endpoint. It does not reimplement the API call; it depends on the parser and reuses its InvoiceParserService.
| Package | Responsibility |
|---|---|
sharpapi/laravel-invoice-parser |
Calls the SharpAPI endpoint, returns the raw structured JSON. |
sharpapi/laravel-invoice-manager |
Stores that JSON in a managed database and gives you models, jobs, a command, and a Nova admin. |
Install the manager and the parser comes with it.
Use Cases
- Accounts payable automation: vendor invoices land as structured rows, ready for approval and posting.
- ERP and accounting sync: feed parsed invoices into SAP, Oracle, NetSuite, QuickBooks, or Xero.
- Spend analytics and vendor management: query line items, totals, and tax across every supplier.
- Audit and compliance: keep the full raw payload alongside the normalized data for traceability.
- Document digitization: convert scanned and photographed invoices into clean database records.
Requirements
- PHP >= 8.1
- Laravel >= 10.48.29
- A SharpAPI API key (free to start at SharpAPI.com)
- Laravel Nova (optional, only if you want the admin UI)
Installation
-
Install the package via
composer: -
Register at SharpAPI.com to obtain your API key.
-
Set the API key in your
.envfile (used by the underlying parser): -
Run the migrations (tables are created with the
invoice_prefix by default): -
[OPTIONAL] Publish the configuration file:
- [OPTIONAL] Publish the migrations to customize them before running:
Quickstart
1. Artisan command
Parse and store an invoice inline (hits SharpAPI with your key):
On success it prints a table of the stored invoices:
Drop --sync to dispatch the work to a queue instead:
2. Queued job
The job parses the file with SharpAPI, then persists every invoice in the result. Configure the queue connection and name in config/sharpapi-invoice-manager.php.
3. Service (full control)
If you already have a parse result (for example from a webhook), store it directly:
Listen for imports
Every successful import fires an event:
How an import flows
On import the mapper coerces empty strings to null, numeric strings to numbers, and date strings to Carbon dates. The whole element is also stored verbatim in raw_payload for lossless re-processing.
Data model (all tables and fields)
All tables use the configurable invoice_ prefix (shown without the prefix below). Money columns are decimal(15,2), dates are real date columns, and empty strings from the API are coerced to null.
| Table | Holds |
|---|---|
invoices |
One row per detected invoice: document, invoice, and financial scalars as real columns; references, e-invoice, sales info, payment, logistics, and source pages as JSON; plus the full raw_payload. |
invoice_parties |
One seller and one buyer per invoice, with billing and delivery addresses flattened to columns. |
invoice_bank_details |
Bank accounts belonging to a party. |
invoice_line_items |
Every line item, with money and quantities as decimals and date fields as real dates. |
invoice_tax_details |
Tax breakdown rows (type, rate, taxable amount, tax amount). |
Eloquent models
The package ships five Eloquent models (namespace SharpAPI\InvoiceManager\Models). Each can be swapped for your own subclass via the models.* config keys.
| Model | Backing table | Config key | Relationships and helpers |
|---|---|---|---|
Invoice |
invoices |
models.invoice |
lineItems, taxDetails, parties, seller, buyer, total accessor |
InvoiceParty |
invoice_parties |
models.party |
invoice, bankDetails, sellers() / buyers() scopes |
InvoiceBankDetail |
invoice_bank_details |
models.bank_detail |
party |
InvoiceLineItem |
invoice_line_items |
models.line_item |
invoice |
InvoiceTaxDetail |
invoice_tax_details |
models.tax_detail |
invoice |
Configuration
config/sharpapi-invoice-manager.php:
Point any models.* entry at your own subclass to add behaviour without forking the package.
Laravel Nova admin
If Laravel Nova is installed and nova.enabled is true, the package registers an Invoice resource automatically, with the line items, tax details, and parties exposed as related resources, and the raw JSON groups shown as read-only code fields. No manual registration required.
If Nova is not installed, nothing happens and the rest of the package works exactly the same.
The package ships five Nova resources (namespace SharpAPI\InvoiceManager\Nova), listed separately from the Eloquent models above. Only the top-level Invoice resource appears in the navigation; the rest are exposed as related (HasMany) sub-resources from the invoice detail view.
| Nova resource | Backing model | In navigation | Key fields and panels |
|---|---|---|---|
Nova\Invoice |
Invoice |
Yes (group "Invoices") | Index: invoice number, seller, buyer, currency, total, issue date. Detail panels: Document, Invoice, Financials, Raw Groups (references, e-invoice, payment, logistics, sales info, raw payload as read-only code fields). HasMany: line items, tax details, parties. |
Nova\InvoiceParty |
InvoiceParty |
No (sub-resource) | Role, name, VAT id, registration number, addresses, contact JSON. HasMany bank details. |
Nova\InvoiceLineItem |
InvoiceLineItem |
No (sub-resource) | Line number, description, quantity, unit price, subtotal, tax, totals, codes, expiry date. |
Nova\InvoiceTaxDetail |
InvoiceTaxDetail |
No (sub-resource) | Tax type, rate, taxable amount, tax amount. |
Nova\InvoiceBankDetail |
InvoiceBankDetail |
No (sub-resource) | Bank name, account name, account number, SWIFT, IBAN. |
To point the admin at your own customized resource, set nova.resource in the config to your subclass. The sub-resources are registered automatically alongside it.
Testing
The suite runs fully offline against a committed fixture using Orchestra Testbench and in-memory SQLite. No API key and no network access are required.
Suggested GitHub topics
laravel-invoice-manager, invoice-management, laravel-invoice, ai-invoice-parser, accounts-payable, laravel-nova, nova-resource, invoice-database, invoice-ocr, sharpapi
Support & Feedback
For issues or suggestions, please:
Changelog
Please see CHANGELOG for a detailed list of changes.
Credits
- A2Z WEB LTD
- Dawid Makowski
- Enhance your Laravel AI capabilities!
License
The MIT License (MIT). Please see License File for more information.
Follow Us
Stay updated with news, tutorials, and case studies:
All versions of laravel-invoice-manager with dependencies
ext-json Version *
laravel/framework Version ^10.48.29|^11.0|^12.0|^13.0
sharpapi/laravel-invoice-parser Version ^1.0