jeffersongoncalves/laravel-erp-crm
Composer 安装命令:
composer require jeffersongoncalves/laravel-erp-crm
包简介
ERP CRM — leads, opportunities and campaigns for the Laravel ERP ecosystem
README 文档
README
ERP CRM — leads, opportunities and campaigns for the Laravel ERP ecosystem.
This package is the CRM module of an ERPNext-native rebuild. It owns the pre-sales relationship documents (leads, opportunities, campaigns, contracts and appointments) and converts them into the downstream selling documents. It depends on jeffersongoncalves/laravel-erp-core and jeffersongoncalves/laravel-erp-selling.
Features
- CRM masters — Lead sources, campaigns and contracts (with party, signing status and contract terms).
- Leads — A relationship record with contact details and its own workflow status (
Lead → Open → Replied → Opportunity → Quotation → Converted, plusDo Not Contact), tied to a lead source and campaign. - Opportunities — A qualified deal with line items, amount, probability, type (
Sales,Support,Maintenance) and an ERPNext-style status (Open,Quotation,Converted,Lost,Closed,Replied). - Appointments — Scheduled meetings with a party and contact details.
- Conversion services —
LeadServicepromotes a lead into a selling Customer (flagging the leadConverted) or opens an Opportunity from it;OpportunityServiceturns an opportunity into a draft selling Quotation, copying every line. - Customizable Models — Override any model via config (ModelResolver pattern).
- Translations — English and Brazilian Portuguese.
Compatibility
| Package | PHP | Laravel |
|---|---|---|
^1.0 |
^8.2 |
^11.0 | ^12.0 | ^13.0 |
Installation
composer require jeffersongoncalves/laravel-erp-crm
Publish and run the migrations (the core and selling package migrations must be published too):
php artisan vendor:publish --tag="erp-core-migrations" php artisan vendor:publish --tag="erp-selling-migrations" php artisan vendor:publish --tag="erp-crm-migrations" php artisan migrate
Publish the config (optional):
php artisan vendor:publish --tag="erp-crm-config"
Conversion
LeadService and OpportunityService are registered as singletons.
use JeffersonGoncalves\Erp\Crm\Services\LeadService; use JeffersonGoncalves\Erp\Crm\Services\OpportunityService; // Lead -> Customer (the lead is flagged Converted and linked to the new customer) $customer = app(LeadService::class)->createCustomer($lead); // Lead -> Opportunity (the lead moves to the Opportunity stage) $opportunity = app(LeadService::class)->createOpportunity($lead); // Opportunity -> Quotation (draft; the opportunity moves to the Quotation stage) $quotation = app(OpportunityService::class)->createQuotation($opportunity);
- createCustomer instantiates the selling
Customerfrom the lead (using the company name when present), saves it, then links the lead back viacustomer_idand flags itConverted. - createOpportunity opens a CRM
Opportunityfrom the lead (opportunity_from = Lead) and moves the lead to theOpportunitystage. - createQuotation copies the party/company onto a draft selling
Quotationand copies every opportunity line into a quotation line, then moves the opportunity to theQuotationstage.
Database Tables
All tables use the configured prefix shared across the ERP ecosystem (default: erp_): lead_sources, campaigns, contracts, leads, opportunities, opportunity_items, appointments.
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-28