idoneo/humano-billing
Composer 安装命令:
composer require idoneo/humano-billing
包简介
Comprehensive billing and payment management system for Humano applications
README 文档
README
Comprehensive billing and payment management system for Humano applications. This package provides a complete solution for managing invoices, payments, and accounting operations with multi-tenant support.
📦 Features
Core Functionality
- ✅ Invoice Management - Full CRUD operations for invoices
- ✅ Payment Tracking - Comprehensive payment records with transaction types
- ✅ Multi-Tenant - Team-based isolation with global scopes
- ✅ DataTables Integration - Beautiful, searchable, sortable tables
- ✅ Type Safety - PHP 8.1 ENUMs for transaction types
- ✅ Stripe Integration - Via Laravel Cashier
- ✅ Activity Logging - Track all billing changes
- ✅ Permissions - Spatie Permission integration
- ✅ Translations - English and Spanish support
Models
Invoice- Main invoice recordsInvoiceItem- Line items for detailed billingInvoiceType- Purchase/Sale categorizationPayment- Transaction records with status trackingPaymentAccount- Bank and payment account managementPaymentType- 16 predefined payment methods
Payment Methods Supported
- Cash
- Bank Transfer
- Bank Deposit
- Check
- Debit Card
- Credit Card
- PayPal
- Stripe
- Zelle
- Venmo
- Cash App
- MercadoPago
- Bank Draft
- Wire Transfer
- Other
- N/A
📋 Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
- MySQL 5.7+ or MariaDB 10.3+
- Composer
🚀 Installation
Step 1: Install via Composer
composer require idoneo/humano-billing
Step 2: Publish Migrations
php artisan vendor:publish --tag="humano-billing-migrations"
Step 3: Run Migrations
php artisan migrate
Step 4: Publish Configuration (Optional)
php artisan vendor:publish --tag="humano-billing-config"
Step 5: Publish Views (Optional)
php artisan vendor:publish --tag="humano-billing-views"
📖 Usage
Basic Invoice Creation
use Idoneo\HumanoBilling\Models\Invoice; $invoice = Invoice::create([ 'team_id' => auth()->user()->currentTeam->id, 'enterprise_id' => $enterprise->id, 'number' => 'INV-2025-001', 'type_id' => 2, // Sale invoice 'issue_date' => now(), 'due_date' => now()->addDays(30), 'subtotal' => 1000.00, 'tax' => 150.00, 'total' => 1150.00, 'status' => 1, // Draft ]);
Adding Invoice Items
use Idoneo\HumanoBilling\Models\InvoiceItem; InvoiceItem::create([ 'invoice_id' => $invoice->id, 'service_id' => $service->id, 'description' => 'Web Hosting - Monthly', 'quantity' => 1, 'unit_price' => 1000.00, 'total' => 1000.00, ]);
Recording Payments
use Idoneo\HumanoBilling\Models\Payment; use Idoneo\HumanoBilling\Enums\TransactionType; $payment = Payment::create([ 'team_id' => auth()->user()->currentTeam->id, 'enterprise_id' => $enterprise->id, 'invoice_id' => $invoice->id, 'transaction_type' => TransactionType::INCOME, 'date' => now(), 'amount' => 1150.00, 'type_id' => 2, // Bank Transfer 'account_id' => $account->id, 'status' => 2, // Approved 'remarks' => 'Payment received', ]);
Using Transaction Type ENUM
use Idoneo\HumanoBilling\Enums\TransactionType; // Get label echo TransactionType::INCOME->label(); // "Income" echo TransactionType::EXPENSE->label(); // "Expense" // Get color echo TransactionType::INCOME->color(); // "success" echo TransactionType::EXPENSE->color(); // "danger" // Get badge HTML echo TransactionType::INCOME->badge(); // <span class="badge..."></span>
🎨 DataTables
Invoice DataTable
use Idoneo\HumanoBilling\DataTables\InvoiceDataTable; public function index(InvoiceDataTable $dataTable) { return $dataTable->render('humano-billing::invoices.index'); }
Payment DataTable
use Idoneo\HumanoBilling\DataTables\PaymentDataTable; public function index(PaymentDataTable $dataTable) { return $dataTable->render('humano-billing::payments.index'); }
🗄️ Database Schema
Invoices Table
id- Primary keyteam_id- Foreign key to teamsenterprise_id- Foreign key to enterprisesnumber- Invoice number (unique per team)type_id- Foreign key to invoice_typesissue_date- Invoice issue datedue_date- Payment due datesubtotal- Subtotal amounttax- Tax amounttotal- Total amountstatus- Invoice status
Payments Table
id- Primary keyteam_id- Foreign key to teamsenterprise_id- Foreign key to enterprisesinvoice_id- Foreign key to invoices (nullable)transaction_type- ENUM (income, expense)date- Payment dateamount- Payment amount (decimal 15,2)type_id- Foreign key to payment_typesaccount_id- Foreign key to payment_accountsstatus- Payment statusremarks- Additional notes
🔐 Permissions
The package respects Laravel's authorization system. Make sure to define appropriate policies:
// In AuthServiceProvider use Idoneo\HumanoBilling\Models\Invoice; use App\Policies\InvoicePolicy; protected $policies = [ Invoice::class => InvoicePolicy::class, ];
🌍 Translations
The package includes translations for English and Spanish. Add your own translations by publishing the language files:
php artisan vendor:publish --tag="humano-billing-lang"
🧪 Testing
cd packages/humano-billing composer test
📝 Changelog
Please see CHANGELOG for more information on what has changed recently.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
🔒 Security
If you discover any security-related issues, please email diego.mascarenhas@icloud.com instead of using the issue tracker.
👨💻 Credits
- Diego Adrián Mascarenhas Goytía - GitHub
📄 License
The AGPL-3.0 License. Please see License File for more information.
💡 Support
For support, email diego.mascarenhas@icloud.com or open an issue on GitHub.
Made with ❤️ by IDONEO
idoneo/humano-billing 适用场景与选型建议
idoneo/humano-billing 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 101 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payments」 「laravel」 「billing」 「invoicing」 「idoneo」 「humano-billing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 idoneo/humano-billing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 idoneo/humano-billing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 idoneo/humano-billing 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Cashier provides an expressive, fluent interface to Braintree's subscription billing services.
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
Metamel Addresses is a polymorphic Laravel package, for address book management. You can add addresses to any eloquent model with ease.
Alfabank REST API integration
统计信息
- 总下载量: 101
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0
- 更新时间: 2025-10-03