PHP code example of vasilgerginski / filament-accounting

1. Go to this page and download the library: Download vasilgerginski/filament-accounting library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vasilgerginski / filament-accounting example snippets


use VasilGerginski\FilamentAccounting\FilamentAccountingPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentAccountingPlugin::make(),
        ]);
}

return [
    // Navigation group name
    'navigation_group' => 'Accounting',

    // Currency settings
    'currency' => 'EUR',
    'currency_symbol' => '€',
    'currency_label' => 'EUR',

    // User relationship for incomes
    'enable_user_relation' => true,
    'user_model' => 'App\\Models\\User',
    'user_label' => 'Client',
    'user_role_filter' => null, // e.g., 'client'

    // Enable/disable specific resources
    'resources' => [
        'expenses' => true,
        'expense_types' => true,
        'incomes' => true,
        'income_types' => true,
    ],
];

FilamentAccountingPlugin::make()
    ->expenses(true)
    ->expenseTypes(true)
    ->incomes(true)
    ->incomeTypes(false), // Disable income types
bash
php artisan vendor:publish --tag="filament-accounting-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-accounting-config"