Weave 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

Referenceable is a Laravel package that adds customizable reference numbers to Eloquent models. It offers random, sequential, and template-based generation with placeholders like {YEAR} and {SEQ}, plus collision handling, validation, multi-tenancy, and Artisan commands.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for "reference number" infrastructure. Nearly every B2B/ops product eventually needs human-quotable identifiers (order numbers, invoice numbers, ticket IDs, claim references) that are short, unique, printable on PDFs, and readable over the phone. This package collapses that from a bespoke sprint of code into a trait + config file, letting you decide to buy instead of build.
  • Prioritizing the "customer-facing identifier" feature over internal ID plumbing. Because prefixes, separators, and template placeholders ({YEAR}, {MONTH}, {SEQ}) are configuration rather than code, you can ship format changes as a config/ops decision — useful when sales or a partner integration mandates a numbering convention late in a release cycle.
  • Roadmap sequencing for multi-tenant and regional expansion. uniqueness_scope = global | model | tenant plus a tenant column makes "unique per company" a config flag rather than a schema migration, which de-risks the multi-tenant milestone and lets you sequence it independently of the numbering work.
  • Compliance and audit-readiness decisions. Sequential mode with daily/monthly/yearly reset is the shape regulators and finance teams ask for on invoices and receipts. This package lets you prototype that model cheaply, but the decision to rely on it for statutory numbering needs a separate sign-off (see risks below).
  • Data migration and backfill scope. php artisan referenceable:generate "App\Models\Order" --dry-run/--batch and validate --fix turn "we have 400k legacy rows with no reference" from an engineering project into a runbook item — a meaningful scope reduction when estimating a launch-readiness epic.
  • Support-cost and CX decisions. Excluding ambiguous characters (01IOL) directly reduces mistyped references in support calls and manual data entry; that is a small but measurable CX lever you can defend in a prioritization review.
  • Scope discipline on a "nice to have." With 87 stars, zero dependents, and a single maintainer, the honest PM decision here is usually "adopt as a thin, replaceable utility, not as a platform dependency" — which sets the expectation that no roadmap item should ever be blocked on this package's maintainer.

When to Consider This Package

Good fit when:

  • You are on Laravel 10–13 and generating references at the Eloquent layer (model create/save), not via raw SQL bulk inserts or an external service.
  • Your volume is moderate (thousands to low millions of rows) and you can accept application-level uniqueness enforcement backed by a DB unique index.
  • The identifier is cosmetic/operational (customer-facing convenience, support lookup, printed docs) rather than legally binding.
  • You need backfill tooling for existing tables — the Artisan commands are the strongest differentiator versus writing a trait by hand.
  • You want multi-tenant uniqueness without designing counter tables yourself.
  • You are comfortable owning a fork: the code surface is small enough that vendoring or reimplementing is realistic if the package stalls.

Look elsewhere (or build in-house) when:

  • The number must be legally gapless or regulatorily sequential (e.g., EU invoice numbering, fiscal receipt series). Application-level sequencing with retries and transaction wrappers cannot guarantee gaplessness under rollback or concurrency; use a DB sequence, dedicated counter service, or a specialized invoicing library — and get finance/legal review.
  • You need high-concurrency sequential generation (hundreds of writes/sec on a single series). Validate the counter-table + retry design under load before committing; the README makes no benchmark claims.
  • References must be generated outside Eloquent (bulk insert(), queue workers writing raw SQL, third-party systems) — the trait won't fire.
  • You require vendor accountability: no SLA, no security policy in practice, one maintainer, and no visible test-suite or CI badge in the supplied docs. Treat it as community-tier.
  • Your stack is not Laravel, or you are mid-migration off it.
  • You need format versioning with immutability guarantees (e.g., references must never be re-issued after regeneration). regenerateReference() and --fix are footguns here; you would need to wrap and restrict them.

Diligence items to close before adoption:

  • The README's batch-ops example imports MohamedSaid\ModelReference\ModelReference while the package is now referenceable (renamed from model-reference in v2.0.3). Expect namespace drift in blog posts and Stack Overflow answers; confirm the current namespace against composer.json and the actual release tag.
  • Confirm the test suite exists and passes on your Laravel/PHP versions — the supplied maturity signal is "readme, changelog, releases" only.
  • Verify the release cadence claims by checking whether v2.2.0's contents match the docs (several changelog entries are auto-generated compare links with no described changes).

How to Pitch It (Stakeholders)

To executives (one paragraph): Customers, support agents, and finance teams need short, quotable identifiers on orders, invoices, and tickets — today we would build that from scratch as custom code in every model. This MIT-licensed Laravel package provides it as configuration: prefixes, date-based templates, sequential numbering with reset periods, per-tenant uniqueness, and one-command backfill for existing records. Adopting it removes roughly a sprint of low-differentiation work from the launch path and makes future format changes a config change rather than a release. The trade-off is dependency risk: it is a small, single-maintainer, low-adoption package, so we will pin the version and keep it behind a thin internal wrapper so it can be replaced in a day if needed. We should not use it as the system of record for legally mandated invoice numbering without a finance/legal sign-off.

To engineering (framing): Treat it as a replaceable utility, not a framework. Add the HasReference trait, keep a DB unique() index on the column (and a composite index for tenant scope), and wrap all generation/regeneration calls in your own service class so call sites never touch the package namespace directly. Pin the version; do not use --all regeneration or --fix in production without a reviewed runbook. Benchmark sequential mode under realistic concurrency before using it for anything financial, and pre-approve a fallback plan (a ~200-line internal trait or a DB sequence) since the code surface is small. Budget roughly half a day for adoption plus a day of diligence on tests, concurrency, and the namespace/rename drift between model-reference and referenceable.

Bottom line: Worth a time-boxed spike for operational reference numbers on a Laravel product; not a safe foundation for regulated or high-concurrency sequential numbering. Expected value is "saves a sprint, costs a day of diligence, carries a small and easily-contained dependency risk."

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums