shan016/laravel-autonumber

Laravel package to create autonumber for Eloquent model

Maintainers

Package info

github.com/shan016/laravel-autonumber

pkg:composer/shan016/laravel-autonumber

Statistics

Installs: 29

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0 2026-01-02 04:06 UTC

This package is auto-updated.

Last update: 2026-04-18 07:06:50 UTC


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

  1. Update the package:

    composer require shan016/laravel-autonumber:^2.0
  2. (Optional) Republish configuration:

    php artisan vendor:publish --provider="Shan016\AutoNumber\AutoNumberServiceProvider" --force
  3. Run migrations:

    php artisan migrate
  4. Verify your model:

    • Uses AutoNumberTrait
    • Implements getAutoNumberOptions()

🧪 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!