
I built an open-source Laravel client for ERPNext and Frappe
I've released kayedspace/laravel-erpnext, an MIT-licensed package for connecting Laravel applications to ERPNext and Frappe.
The main design decision was to treat DocTypes as generic resources. You can work with a standard or custom DocType by name without creating a PHP class, mapping, or registration first:
use Kayedspace\Erpnext\Facades\Erpnext;
$overdue = Erpnext::doctype('Sales Invoice')->query()
->where('status', 'Overdue')
->fields(['name', 'customer', 'outstanding_amount'])
->orderBy('creation', 'asc')
->limit(200)
->get();
The package also includes:
- Token, Basic, Bearer, and cached Session authentication.
- Frappe-aware filters and full-result pagination with
each(),chunk(), andlazy(). - Create, read, update, delete, and whitelisted document method calls.
- Private-by-default file uploads, attachments, image optimization, and authenticated downloads.
- Multi-tenant connection resolution and focused retries for rate limits or unavailable sites.
- Optional typed wrappers for eight common DocTypes, including invoice and payment submission lifecycles.
I tried to keep the generic API as the normal path and make typed documents optional. ERPNext still decides required fields, permissions, custom fields, and which document methods are available.
Installation is:
composer require kayedspace/laravel-erpnext
Source: https://github.com/kayedspace/laravel-erpnext
Documentation: https://laravel-erpnext.kayed.dev
I would especially value feedback from people maintaining real Laravel-to-ERPNext integrations. Which part usually causes the most trouble in your projects: authentication, DocType queries, document lifecycles, files, or keeping local and ERPNext records synchronized?