yearul / lara-invoice
Laravel 发票号码生成器是一个强大且灵活的包,简化了在 Laravel 应用程序中生成唯一发票号码的过程。它提供了一种方便的解决方案来管理发票号码,确保它们是唯一的、连续的,并且可以根据您的特定要求进行定制。
Requires
- php: >=7.4|^8.0
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
这里应该是您的描述。限制在一两段之内。考虑添加一个小示例。
Laravel 版本 10.*
描述
标题:Laravel 发票号码生成器
Laravel 发票号码生成器是一个强大且灵活的包,简化了在 Laravel 应用程序中生成唯一发票号码的过程。它提供了一种方便的解决方案来管理发票号码,确保它们是唯一的、连续的,并且可以根据您的特定要求进行定制。
功能
唯一发票号码生成:该包生成唯一的发票号码,以避免冲突并确保准确记录。
连续编号:发票号码以连续的方式生成,便于跟踪和组织发票。
可定制格式:您可以定义发票号码的定制格式,允许您结合各种元素,例如前缀、后缀、日期格式和连续编号模式。
与 Laravel 生态系统集成:该包无缝集成到 Laravel 中,利用其强大的功能和生态系统。它使用 Laravel 的模型事件和数据库迁移以简化设置和配置。
可配置选项:该包提供了各种配置选项,包括设置初始发票号码、配置发票号码长度、定义前缀和后缀值以及指定日期格式的能力。
多个发票号码生成器:您可以根据不同的配置创建多个发票号码生成器,以处理应用程序中的特定用例。例如,您可能有不同分支或部门的不同发票编号。
可扩展和可定制:该包旨在可扩展,允许您根据特定需求自定义其功能。您可以覆盖默认行为,实现自己的生成算法或扩展现有类。
文档齐全且受支持:Laravel 发票号码生成器包经过充分文档化,提供了有关安装、配置和使用方面的清晰说明。此外,它还受益于活跃的社区和持续的支持,以解决您可能遇到的问题或疑问。
使用 Laravel 发票号码生成器包,您可以简化您的开票流程,确保发票号码准确且唯一,并提高财务记录的整体组织和跟踪。
安装
您可以通过 composer 安装该包
composer require yearul/lara-invoice
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="lara-invoice-config"
这是发布配置文件的内容
return [ /* |-------------------------------------------------------------------------- | Invoice NO Generator Config |-------------------------------------------------------------------------- | | This is the config file for Invoice NO generator. You can override | this config file by placing it in your application's config directory | and change the values as per your need. | */ /* |-------------------------------------------------------------------------- | Default Pad Length |-------------------------------------------------------------------------- | | If no pad length is provided to the generate method, this value will be used | */ "pad_len" => 5, /* |-------------------------------------------------------------------------- | Default Prefix |-------------------------------------------------------------------------- | | If no prefix is provided to the generate method, this value will be used | */ "prefix" => "YEA", /* |-------------------------------------------------------------------------- | Default year and year_val |-------------------------------------------------------------------------- | | If no year and year_val is provided to the generate method, this value will be used | */ "year" => true, "year_val" => date('Y'), /* |-------------------------------------------------------------------------- | Default pad string |-------------------------------------------------------------------------- | | If no pad string is provided to the generate method, this value will be used | */ "pad_string" => 0, // 0, #, *, $.......etc /* |-------------------------------------------------------------------------- | Default pad_direction |-------------------------------------------------------------------------- | | If no pad_direction is provided to the generate method, this value will be used | */ "pad_direction" => STR_PAD_LEFT, // STR_PAD_LEFT, STR_PAD_RIGHT ];
可选地,您可以使用以下命令发布视图
php artisan vendor:publish --tag="lara-invoice-views"
用法
use Yearul\LaraInvoice\LaraInvoice; // import this in the top of the class $value = LaraInvoice::generate(2); // 2 is input value echo $value; //Output YEA-2023-00002 //Generate Method // generate($input, $pad_len = null, $pad_string = null, $prefix = null, $year = null) // the generate method received 5 value, $input value is mandatory and others value not mandatory( thoes can get from config file and also Manual Input)
测试
composer test
更新日志
有关最近更改的更多信息,请参阅更新日志。
贡献
有关详细信息,请参阅贡献指南。
安全漏洞
有关报告安全漏洞的详细信息,请参阅我们的安全策略。
鸣谢
许可证
MIT许可证(MIT)。请参阅许可证文件获取更多信息。