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

Referenceable Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Compliance & Auditing: Enforce standardized reference formats (e.g., INV-{YEAR}{SEQ}) for invoices, contracts, or medical records to meet regulatory requirements (e.g., HIPAA, GDPR, or industry-specific standards like SOX).
  • User Experience: Replace opaque auto-incremented IDs with human-readable references (e.g., ORD-2024-001) in dashboards, emails, or customer portals to reduce support queries.
  • Multi-Tenancy: Implement tenant-aware references (e.g., TNT-{TENANT_ID}-{SEQ}) for SaaS platforms to ensure uniqueness across shared databases while maintaining isolation.
  • Migration Strategy: Gradually replace legacy ID systems (e.g., UUIDs or raw integers) with configurable references for models like orders, payments, or support_tickets without downtime.
  • Analytics & Reporting: Enable reference-based filtering (e.g., referenceStartsWith('ORD-2024')) for time-period-specific reports or bulk operations.
  • Cost Optimization: Reduce database index bloat by using shorter, optimized reference formats (e.g., {PREFIX}{SEQ}) instead of full UUIDs for non-critical models.
  • Localization: Support locale-specific reference formats (e.g., date formats like {DD/MM/YY}) for global applications.
  • Legacy System Integration: Generate references matching external system requirements (e.g., ERP or CRM formats) via the template system.

When to Consider This Package

Adopt this package if:

  • Your Laravel application requires human-readable, unique identifiers for critical models (e.g., invoices, orders, or cases).
  • You need flexible reference formats (random, sequential, or template-based) to align with branding, compliance, or user expectations.
  • Your system supports multi-tenancy and requires tenant-isolated references.
  • You’re migrating from auto-incremented IDs or UUIDs to a more maintainable reference system.
  • You need batch operations (e.g., generating references for 10,000+ records) with collision handling.
  • Your team lacks the bandwidth to build a custom reference generator from scratch.

Look elsewhere if:

  • You only need simple auto-incremented IDs (use Laravel’s built-in incrementing primary keys).
  • Your references are trivially simple (e.g., user_{id}) and don’t require validation or uniqueness guarantees.
  • You’re using a non-Laravel backend (e.g., Django, Node.js) or a headless API without model persistence.
  • Your references must integrate with third-party systems that enforce rigid formats (e.g., ISO 8601 timestamps) not supported by the template system.
  • You require real-time reference generation (e.g., for high-frequency trading) and the package’s collision retries introduce latency.

How to Pitch It (Stakeholders)

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:

  • Three strategies (random, sequential, template-based) to fit any use case.
  • Zero collisions via built-in retries or appends, with configurable uniqueness scopes (global/tenant/model).
  • Performance optimized with caching, transactions, and batch processing—critical for bulk operations.
  • Multi-tenant ready out of the box, with tenant-aware uniqueness.
  • Artisan commands for migrations, validation, and stats (e.g., php artisan referenceable:generate App\Models\Order).
  • Backward-compatible with Laravel 10–13 and easy to extend.

It’s like Laravel’s uuid package, but for human-readable, customizable references—and it’s MIT-licensed with active maintenance."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport