artflow-studio / accountflow
A reusable dynamic accounts module for Laravel.
Installs: 66
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/artflow-studio/accountflow
Requires
README
Version: 3.0.0
Date: November 18, 2025
Status: โ
Production Ready & Fully Tested
๐ Table of Contents
- Features
- Installation
- Quick Start
- Admin Management
- Feature Management
- Blade Directives
- Middleware
- Commands
- Services
- Testing
โจ Features
Core Accounting
- โ Multi-Account Management
- โ Transactions (Income/Expense/Transfer)
- โ Categories (Hierarchical)
- โ Payment Methods
- โ Real-time Balance Tracking
Advanced Features
- ๐ Financial Reports (P&L, Trial Balance, Cashbook)
- ๐ฐ Budgets & Variance Analysis
- ๐ฆ Assets Management
- ๐ธ Loans Management
- ๐ฅ Equity Partners
- ๐ Planned Payments
- ๐ผ Transaction Templates
- ๐ Audit Trail
- ๐ User Wallets
- ๐ณ Payment Methods Management
- ๐ท๏ธ Categories Management
- ๐ Account Transfers
Feature Control
- ๐ง Enable/Disable 20+ Features
- ๐ก๏ธ Middleware Protection for Routes
- ๐จ Blade Directives (@featureEnabled/@featureDisabled)
- โ๏ธ Granular Permission Control
- ๐ฏ Feature-based Navigation Hiding
๐ Installation
# Install composer require artflow-studio/accountflow # Migrate php artisan migrate # Seed php artisan accountflow:seed # Check status php artisan accountflow:status
๐ฏ Quick Start
use ArtflowStudio\AccountFlow\Facades\Accountflow; // Create transaction $transaction = Accountflow::transactions()->createIncome([ 'amount' => 1000, 'category_id' => 2, 'account_id' => 1, ]); // Get balance $balance = Accountflow::accounts()->getBalance($accountId); // Log audit (if enabled) if (Accountflow::features()->isEnabled('audit')) { Accountflow::audit()->logTransactionCreated($transaction->id, $transaction->toArray()); }
๐ง Feature Management
Enable/Disable Features
# Via command php artisan accountflow:feature audit enable php artisan accountflow:feature budgets disable php artisan accountflow:feature categories enable php artisan accountflow:feature payment_methods enable
// Via code Accountflow::features()->enable('audit'); Accountflow::features()->disable('budgets'); Accountflow::features()->isEnabled('audit'); // true/false Accountflow::features()->toggle('categories');
Available Features
Core Modules:
multi_accounts_module- Multi-account supportcustom_category- Custom categoriesassets_module- Assets managementpurchase_module- Purchase managementmulti_payment_methods- Multiple payment methods
Financial Management:
budgets_module- Budget tracking & managementplanned_payments_module- Recurring planned paymentsloan_module- Loans managementequity_module- Equity partners managementuser_wallet_module- User walletsincome_form- Income form module
Transaction Features:
transaction_templates- Reusable transaction templatespayment_methods_module- Payment methods managementcategories_module- Categories managementtransfers_module- Account transfers
Reports:
cashbook_module- Cashbook reporttrial_balance_module- Trial balance reportprofit_loss_report- Profit & Loss reporttrial_balance_report- Trial balance report
System:
audit_trail- Complete audit logging
๐จ Blade Directives
{{-- Show/hide based on feature --}} @featureEnabled('audit') <a href="/audit-trail">View Audit Trail</a> @endFeatureEnabled @featureDisabled('budgets') <div>Budgets module is currently disabled</div> @endFeatureDisabled @featureEnabled('categories') <a href="/categories">Manage Categories</a> @endFeatureEnabled {{-- In navigation --}} <nav> @featureEnabled('audit') <li><a href="/audit">Audit</a></li> @endFeatureEnabled @featureEnabled('budgets') <li><a href="/budgets">Budgets</a></li> @endFeatureEnabled @featureEnabled('categories') <li><a href="/categories">Categories</a></li> @endFeatureEnabled @featureEnabled('payment_methods') <li><a href="/payment-methods">Payment Methods</a></li> @endFeatureEnabled </nav>
๐ก๏ธ Middleware
// Protect routes Route::get('/audit-trail', Controller::class) ->middleware('accountflow.feature:audit'); Route::get('/budgets', Controller::class) ->middleware('accountflow.feature:budgets'); Route::get('/categories', Controller::class) ->middleware('accountflow.feature:categories'); // Group protection Route::middleware(['auth', 'accountflow.feature:payment_methods'])->group(function () { Route::get('/payment-methods', [PaymentMethodController::class, 'index']); Route::get('/payment-methods/create', [PaymentMethodController::class, 'create']); });
๐ฎ Commands
Testing
php artisan accountflow:test-complete # Run all tests php artisan accountflow:test-facade # Test facade php artisan accountflow:test-features # Test features
Management
php artisan accountflow:status # System status php artisan accountflow:seed # Seed data php artisan accountflow:feature {name} {enable|disable} php artisan accountflow:analyze-livewire # Analyze components
๐ฆ Services (9 Total)
1. TransactionService
Accountflow::transactions()->createIncome($data); Accountflow::transactions()->createExpense($data); Accountflow::transactions()->update($id, $data); Accountflow::transactions()->delete($id); Accountflow::transactions()->getSummary($start, $end);
2. AccountService
Accountflow::accounts()->create($data); Accountflow::accounts()->getAll(); Accountflow::accounts()->getBalance($id); Accountflow::accounts()->addToBalance($id, $amount); Accountflow::accounts()->subtractFromBalance($id, $amount);
3. SettingsService
Accountflow::settings()->defaultSalesCategoryId(); Accountflow::settings()->defaultExpenseCategoryId(); Accountflow::settings()->get('key', 'default'); Accountflow::settings()->set('key', 'value');
4. FeatureService (NEW!)
Accountflow::features()->isEnabled('audit'); Accountflow::features()->enable('audit'); Accountflow::features()->disable('budgets'); Accountflow::features()->getAllFeatures();
5. AuditService (FIXED!)
Accountflow::audit()->log('created', 'Transaction', $id, null, $data); Accountflow::audit()->logTransactionCreated($id, $data); Accountflow::audit()->getRecent(50); Accountflow::audit()->getByUser($userId);
6-9. Other Services
- CategoryService, PaymentMethodService, BudgetService, ReportService
See docs/SERVICES_INDEX.md for complete API documentation.
๐งช Testing
php artisan accountflow:test-complete
Results:
โ
9/9 tests PASSED
- Status Check
- Facade Resolution
- All Services
- Feature Management
- Real Usage
๐ง What's New in v3.0.0
โ Fixed
- Audit Trail SQL Error - Fixed
model_typefield issue - Container Resolution - Proper namespace structure
- Service Binding - All services registered correctly
โจ New
- Feature Management - Complete feature control system
- Blade Directives -
@featureEnabled,@featureDisabled - Middleware - Route protection
- 14 Commands - Complete test suite
- FeatureService - 9th service added
๐ Documentation
README.md- This filedocs/QUICK_REFERENCE.md- API cheat sheetdocs/SERVICES_INDEX.md- Complete APIISSUE_RESOLVED.md- Recent fixes
๐จ Common Issues
Audit Trail Error (FIXED!)
Error: Field 'model_type' doesn't have a default value
Solution: Updated in v3.0.0
Feature Not Working
php artisan accountflow:status
php artisan accountflow:feature audit enable
๐ก Complete Example
use ArtflowStudio\AccountFlow\Facades\Accountflow; // Enable audit if needed if (!Accountflow::features()->isEnabled('audit')) { Accountflow::features()->enable('audit'); } // Create transaction $transaction = Accountflow::transactions()->createIncome([ 'amount' => 2500, 'description' => 'Client Payment', 'category_id' => Accountflow::settings()->defaultSalesCategoryId(), 'account_id' => 1, 'date' => now(), ]); // Log audit Accountflow::audit()->logTransactionCreated($transaction->id, $transaction->toArray()); // Update balance Accountflow::accounts()->addToBalance($transaction->account_id, $transaction->amount); // Get report $report = Accountflow::reports()->profitAndLoss(now()->startOfMonth(), now()->endOfMonth());
Version: 3.0.0
Status: โ
Production Ready
Last Updated: November 18, 2025
License: MIT