shan016/laravel-autonumber
最新稳定版本:v2.0.0
Composer 安装命令:
composer require shan016/laravel-autonumber
包简介
Laravel package to create autonumber for Eloquent model
README 文档
README
We’re excited to introduce v2.0 of Laravel AutoNumber! This release brings improved compatibility, cleaner integration, and alignment with modern Laravel standards.
✨ What’s New
- Full support for Laravel 10
- Updated for PHP 8.1+
- Improved stability and performance
- Cleaner integration with Eloquent model lifecycle
- Enhanced support for dynamic formats using closures
💥 Breaking Changes
-
Dropped support for:
- Laravel 8
- Laravel 9
- PHP versions below 8.1
If you are using Laravel 8 or 9, please continue using v1.x
🔄 Upgrade Guide
-
Update the package:
composer require shan016/laravel-autonumber:^2.0
-
(Optional) Republish configuration:
php artisan vendor:publish --provider="Shan016\AutoNumber\AutoNumberServiceProvider" --force -
Run migrations:
php artisan migrate
-
Verify your model:
- Uses
AutoNumberTrait - Implements
getAutoNumberOptions()
- Uses
🧪 Example
$order = Order::create([ 'customer' => 'John Doe', ]); echo $order->order_number; // Example output: SO-00001
📦 Installation (Fresh)
composer require shan016/laravel-autonumber:^2.0
🙌 Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
⭐ Support
If you find this package useful, consider giving it a ⭐ on GitHub!
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-15