mortezaa97/factors

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/mortezaa97/factors

v1.0.1 2025-11-06 20:06 UTC

This package is auto-updated.

Last update: 2025-12-06 20:24:00 UTC


README

Latest Version on Packagist Total Downloads

A comprehensive Filament plugin for managing invoices/factors and their items with support for multiple types, barcode scanning, label printing, and more.

Features

  • ๐Ÿงพ Complete Invoice Management: Create, edit, and manage invoices with multiple types
  • ๐Ÿ“ฆ Item Management: Add products to invoices with automatic calculations
  • ๐Ÿ” Barcode Scanning: Built-in barcode scanner for quick product addition (F1 key)
  • ๐Ÿท๏ธ Label Printing: Generate customizable product labels
  • ๐Ÿ“„ Invoice Printing: Professional invoice templates
  • ๐Ÿ” Authorization: Built-in policies for secure access control
  • ๐ŸŒ API Ready: RESTful API endpoints for all resources
  • ๐Ÿ‡ฎ๐Ÿ‡ท Persian Support: Full RTL and Persian language support

Installation

1. Require the package via Composer

composer require mortezaa97/factors

2. Register the Plugin

In your app/Providers/Filament/AdminPanelServiceProvider.php:

use Mortezaa97\Factors\FactorsPlugin;

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

3. Run Migrations

php artisan migrate

4. Clear Caches

php artisan config:clear
php artisan cache:clear

Configuration

Publish the configuration file:

php artisan vendor:publish --tag="factors-config"

Publish migrations:

php artisan vendor:publish --tag="factors-migrations"

Publish views (for label and invoice customization):

php artisan vendor:publish --tag="factors-views"

Usage

See PLUGIN_USAGE.md for detailed usage instructions.

Quick Example

use Mortezaa97\Factors\Models\Factor;

// Create a factor
$factor = Factor::create([
    'customer_id' => $userId,
    'type' => 1, // Sale
    'date_time' => now(),
    'total_price' => 100000,
    'created_by' => auth()->id(),
]);

// Add items
$factor->items()->create([
    'model_type' => 'App\\Models\\Product',
    'model_id' => $productId,
    'count' => 2,
    'unit_price' => 50000,
]);

Available Routes

  • Filament Admin Panel: Automatic resource registration
  • API: /api/factors, /api/factor-items
  • Print: /factors/{id}/labels, /factors/{id}/invoice

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.