artflow-studio/accountflow

There is no license information available for the latest version (0.2.2) of this package.

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

0.2.2 2025-11-18 18:39 UTC

This package is auto-updated.

Last update: 2025-11-18 18:40:44 UTC


README

Version: 3.0.0
Date: November 18, 2025
Status: โœ… Production Ready & Fully Tested

๐Ÿ“‹ Table of Contents

  1. Features
  2. Installation
  3. Quick Start
  4. Admin Management
  5. Feature Management
  6. Blade Directives
  7. Middleware
  8. Commands
  9. Services
  10. 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 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 & 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 & Loss report
  • trial_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_type field 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 file
  • docs/QUICK_REFERENCE.md - API cheat sheet
  • docs/SERVICES_INDEX.md - Complete API
  • ISSUE_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