PHPackages                             artflow-studio/accountflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. artflow-studio/accountflow

ActiveLibrary[Framework](/categories/framework)

artflow-studio/accountflow
==========================

A reusable dynamic accounts module for Laravel.

0.2.2(5mo ago)078PHP

Since Nov 7Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/rahee554/AccountFlow)[ Packagist](https://packagist.org/packages/artflow-studio/accountflow)[ RSS](/packages/artflow-studio-accountflow/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (8)Used By (0)

🎉 AccountFlow Package - Complete Documentation
==============================================

[](#-accountflow-package---complete-documentation)

**Version:** 3.0.0
**Date:** November 18, 2025
**Status:** ✅ Production Ready &amp; Fully Tested

---

📋 Table of Contents
-------------------

[](#-table-of-contents)

1. [Features](#-features)
2. [Installation](#-installation)
3. [Quick Start](#-quick-start)
4. [Admin Management](#-admin-management)
5. [Feature Management](#-feature-management)
6. [Blade Directives](#-blade-directives)
7. [Middleware](#-middleware)
8. [Commands](#-commands)
9. [Services](#-services)
10. [Testing](#-testing)

---

✨ Features
----------

[](#-features)

### Core Accounting

[](#core-accounting)

- ✅ Multi-Account Management
- ✅ Transactions (Income/Expense/Transfer)
- ✅ Categories (Hierarchical)
- ✅ Payment Methods
- ✅ Real-time Balance Tracking

### Advanced Features

[](#advanced-features)

- 📊 Financial Reports (P&amp;L, Trial Balance, Cashbook)
- 💰 Budgets &amp; 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

[](#feature-control)

- 🔧 Enable/Disable 20+ Features
- 🛡️ Middleware Protection for Routes
- 🎨 Blade Directives (@featureEnabled/@featureDisabled)
- ⚙️ Granular Permission Control
- 🎯 Feature-based Navigation Hiding

---

🚀 Installation
--------------

[](#-installation)

```
# Install
composer require artflow-studio/accountflow

# Migrate
php artisan migrate

# Seed
php artisan accountflow:seed

# Check status
php artisan accountflow:status
```

---

🎯 Quick Start
-------------

[](#-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
--------------------

[](#-feature-management)

### Enable/Disable Features

[](#enabledisable-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

[](#available-features)

**Core Modules:**

- `multi_accounts_module` - Multi-account support
- `custom_category` - Custom categories
- `assets_module` - Assets management
- `purchase_module` - Purchase management
- `multi_payment_methods` - Multiple payment methods

**Financial Management:**

- `budgets_module` - Budget tracking &amp; management
- `planned_payments_module` - Recurring planned payments
- `loan_module` - Loans management
- `equity_module` - Equity partners management
- `user_wallet_module` - User wallets
- `income_form` - Income form module

**Transaction Features:**

- `transaction_templates` - Reusable transaction templates
- `payment_methods_module` - Payment methods management
- `categories_module` - Categories management
- `transfers_module` - Account transfers

**Reports:**

- `cashbook_module` - Cashbook report
- `trial_balance_module` - Trial balance report
- `profit_loss_report` - Profit &amp; Loss report
- `trial_balance_report` - Trial balance report

**System:**

- `audit_trail` - Complete audit logging

---

🎨 Blade Directives
------------------

[](#-blade-directives)

```
{{-- Show/hide based on feature --}}
@featureEnabled('audit')
    View Audit Trail
@endFeatureEnabled

@featureDisabled('budgets')
    Budgets module is currently disabled
@endFeatureDisabled

@featureEnabled('categories')
    Manage Categories
@endFeatureEnabled

{{-- In navigation --}}

    @featureEnabled('audit')
        Audit
    @endFeatureEnabled

    @featureEnabled('budgets')
        Budgets
    @endFeatureEnabled

    @featureEnabled('categories')
        Categories
    @endFeatureEnabled

    @featureEnabled('payment_methods')
        Payment Methods
    @endFeatureEnabled

```

---

🛡️ Middleware
-------------

[](#️-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
----------

[](#-commands)

### Testing

[](#testing)

```
php artisan accountflow:test-complete    # Run all tests
php artisan accountflow:test-facade      # Test facade
php artisan accountflow:test-features    # Test features
```

### Management

[](#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)
--------------------

[](#-services-9-total)

### 1. TransactionService

[](#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

[](#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

[](#3-settingsservice)

```
Accountflow::settings()->defaultSalesCategoryId();
Accountflow::settings()->defaultExpenseCategoryId();
Accountflow::settings()->get('key', 'default');
Accountflow::settings()->set('key', 'value');
```

### 4. FeatureService (NEW!)

[](#4-featureservice-new)

```
Accountflow::features()->isEnabled('audit');
Accountflow::features()->enable('audit');
Accountflow::features()->disable('budgets');
Accountflow::features()->getAllFeatures();
```

### 5. AuditService (FIXED!)

[](#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

[](#6-9-other-services)

- CategoryService, PaymentMethodService, BudgetService, ReportService

See `docs/SERVICES_INDEX.md` for complete API documentation.

---

🧪 Testing
---------

[](#-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
----------------------

[](#-whats-new-in-v300)

### ✅ Fixed

[](#-fixed)

- **Audit Trail SQL Error** - Fixed `model_type` field issue
- **Container Resolution** - Proper namespace structure
- **Service Binding** - All services registered correctly

### ✨ New

[](#-new)

- **Feature Management** - Complete feature control system
- **Blade Directives** - `@featureEnabled`, `@featureDisabled`
- **Middleware** - Route protection
- **14 Commands** - Complete test suite
- **FeatureService** - 9th service added

---

📚 Documentation
---------------

[](#-documentation)

- `README.md` - This file
- `docs/QUICK_REFERENCE.md` - API cheat sheet
- `docs/SERVICES_INDEX.md` - Complete API
- `ISSUE_RESOLVED.md` - Recent fixes

---

🚨 Common Issues
---------------

[](#-common-issues)

### Audit Trail Error (FIXED!)

[](#audit-trail-error-fixed)

```
Error: Field 'model_type' doesn't have a default value
Solution: Updated in v3.0.0

```

### Feature Not Working

[](#feature-not-working)

```
php artisan accountflow:status
php artisan accountflow:feature audit enable
```

---

💡 Complete Example
------------------

[](#-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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance70

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/998661a880df4a5ad4fc597f7e6c28e5a11047707b58ac7bb171916aacf65253?d=identicon)[rahee554](/maintainers/rahee554)

---

Top Contributors

[![rahee554](https://avatars.githubusercontent.com/u/76494683?v=4)](https://github.com/rahee554 "rahee554 (8 commits)")

### Embed Badge

![Health badge](/badges/artflow-studio-accountflow/health.svg)

```
[![Health](https://phpackages.com/badges/artflow-studio-accountflow/health.svg)](https://phpackages.com/packages/artflow-studio-accountflow)
```

###  Alternatives

[mhmiton/laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.

236409.6k9](/packages/mhmiton-laravel-modules-livewire)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[raugadh/fila-starter

Laravel Filament Starter.

614.9k](/packages/raugadh-fila-starter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
