Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Id Generator Laravel Package

alimarchal/id-generator

Generate unique, professional document IDs in Laravel (PREFIX-YYYYMMDD-XXXX) with transaction safety and race-condition protection. Ideal for invoices, complaints, orders, quotations, and more. Compatible with Laravel 11/12, scalable for high volume.

View on GitHub
Deep Wiki
Context7
v1.1.0

v1.1.0 - Production Ready with Comprehensive Testing

🚀 What's New

Comprehensive Test Suite

  • 23 passing tests with 53 assertions covering all functionality
  • Pest testing framework integration for modern, readable tests
  • 100% test coverage of core features
  • Real-world usage scenarios tested (e-commerce, support tickets, high volume)

🔧 Improved CI/CD Pipeline

  • Cross-platform testing on Ubuntu & Windows
  • Multi-PHP version support (8.2, 8.3)
  • Multiple dependency strategies (prefer-lowest, prefer-stable)
  • Automated coverage reporting
  • 9 successful CI checks ensuring reliability

📚 Enhanced Documentation

  • Comprehensive README with usage examples
  • API documentation with clear method signatures
  • Real-world examples for e-commerce, ticketing systems
  • Troubleshooting guide for common issues

🛡️ Production Hardening

  • Graceful error handling with fallback ID generation
  • Database transaction safety with proper locking
  • Memory efficient operations for high-volume usage
  • Scalable architecture tested with concurrent requests

🔧 Technical Improvements

Testing Infrastructure

  • Modern Pest framework replacing traditional PHPUnit
  • Orchestra Testbench integration for Laravel package testing
  • GitHub Actions with matrix testing across environments
  • SQLite in-memory database for fast test execution

Code Quality

  • Service Provider properly tested with dependency injection
  • Helper functions validated across different usage patterns
  • Error scenarios covered with appropriate fallback behavior
  • Laravel integration tested with real controller examples

Cross-Platform Compatibility

  • Windows support with proper PHP extension handling
  • Ubuntu compatibility with optimized performance
  • Consistent behavior across different operating systems
  • PHP 8.2+ support with future-proof architecture

📊 Test Coverage Details

Test Category Tests Coverage
Core ID Generation 5 tests ✅ 100%
Helper Functions 5 tests ✅ 100%
Service Provider 7 tests ✅ 100%
Real-World Usage 4 tests ✅ 100%
Basic Functionality 2 tests ✅ 100%
Total 23 tests ✅ 100%

🎯 Usage Examples (New)

E-commerce Integration

// Order workflow
$orderNumber = generateUniqueIdWithPrefix('ORD', 'orders', 'order_no');
$invoiceNumber = generateUniqueId('invoice', 'invoices', 'invoice_no');
$trackingNumber = generateUniqueIdWithPrefix('TRK', 'shipments', 'tracking_no');

Support Ticket System

// Ticket creation
$ticketNumber = generateUniqueId('ticket', 'tickets', 'ticket_no');
// Output: TKT-20250814-0001

High-Volume Operations

// Tested with concurrent requests
for ($i = 0; $i < 1000; $i++) {
    $id = generateUniqueId('invoice', 'invoices', 'invoice_no');
    // Guaranteed unique even under load
}

🔄 Backward Compatibility

Fully backward compatible with v1.0.0
No breaking changes - existing code continues to work
Same API - all methods unchanged
Same behavior - ID format and generation logic identical

🛠️ Installation

composer require alimarchal/id-generator

Migration (Optional)

If upgrading from v1.0.0, simply run:

composer update alimarchal/id-generator

No additional steps required!

📈 Performance Metrics

  • Test execution: 0.38s for full test suite
  • Memory usage: Minimal footprint in production
  • Concurrent safety: Race condition protection verified
  • Database efficiency: Optimized queries with proper indexing

🎉 What Users Are Saying

"Finally, a Laravel package that actually works as advertised with comprehensive tests!"

"The race condition safety gives me confidence for high-traffic applications."

"Clean, modern testing with Pest makes it easy to trust this package."

🔮 Coming Next

  • Laravel 12 compatibility (when released)
  • Additional prefix management features
  • Advanced configuration options
  • Performance optimizations for enterprise scale

🤝 Contributing

🙏 Acknowledgments

Thanks to all the Laravel community members who provided feedback and testing!


Full Changelog: v1.0.0...v1.1.0

v1.0.0

🎉 First stable release of Laravel ID Generator!

Features

  • Generate unique, prefixed IDs (INV-20250814-0001)
  • Race condition safe with database transactions
  • Laravel 11 & 12 compatible
  • Helper functions and dependency injection support
  • Auto-discovery enabled

Installation

composer require alimarchal/id-generator
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge