eg-mohamed/referenceable
Laravel package to make Eloquent models referenceable with customizable reference numbers. Supports random, sequential and template-based formats (YEAR/MONTH/SEQ/RANDOM), collision handling, validation, reset rules (daily/monthly/yearly), multi-tenancy, artisan tools, caching and Laravel 10–13.
INV-{YEAR}{SEQ}) for invoices, contracts, or medical records to meet regulatory requirements (e.g., HIPAA, GDPR, or industry-specific standards like SOX).ORD-2024-001) in dashboards, emails, or customer portals to reduce support queries.TNT-{TENANT_ID}-{SEQ}) for SaaS platforms to ensure uniqueness across shared databases while maintaining isolation.orders, payments, or support_tickets without downtime.referenceStartsWith('ORD-2024')) for time-period-specific reports or bulk operations.{PREFIX}{SEQ}) instead of full UUIDs for non-critical models.{DD/MM/YY}) for global applications.Adopt this package if:
Look elsewhere if:
incrementing primary keys).user_{id}) and don’t require validation or uniqueness guarantees.For Executives:
"This package lets us replace confusing auto-generated IDs (e.g., order_12345) with clear, branded references like ORD-2024-001—improving customer experience, compliance, and reporting. It’s a drop-in solution that handles edge cases like duplicates or multi-tenant conflicts automatically, saving dev time while future-proofing our systems. For example, [Competitor X] uses this exact pattern for invoices, and it’s a key differentiator in their UX. The cost? Minimal—just a Composer install and a few config tweaks."
For Engineers: *"This is a battle-tested Laravel package that solves reference generation for 79+ projects. Key benefits:
php artisan referenceable:generate App\Models\Order).It’s like Laravel’s uuid package, but for human-readable, customizable references—and it’s MIT-licensed with active maintenance."*
How can I help you explore Laravel packages today?