idoneo / humano-billing
Comprehensive billing and payment management system for Humano applications
Installs: 71
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:Blade
pkg:composer/idoneo/humano-billing
Requires
- php: ^8.1
- illuminate/contracts: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
- laravel/cashier: ^15.0
- spatie/laravel-activitylog: ^4.10
- spatie/laravel-package-tools: ^1.16
- spatie/laravel-permission: ^6.0
- yajra/laravel-datatables-oracle: ^10.11 || ^11.0 || ^12.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^7.0 || ^8.0 || ^9.0
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^2.0 || ^3.0 || ^4.0
- pestphp/pest-plugin-arch: ^2.0 || ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^2.0 || ^3.0 || ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
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