mortezaa97 / factors
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/mortezaa97/factors
Requires
- php: ^8.2
- illuminate/container: ^8.12|^9.0|^10.0|^11.0|^12.0
- illuminate/contracts: ^8.12|^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
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.