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

Package Versions Laravel Package

samsonasik/package-versions

PHP 5.6 backport of ocramius/package-versions offering fast, no-IO access to Composer dependency versions from composer.lock. Call Versions::getVersion(), getShortVersion(), or getMajorVersion() to retrieve installed package versions at runtime.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is a Composer plugin, not a Laravel package in the conventional sense. It has no service provider, config file, facade, middleware, or container bindings. It generates a PackageVersions\Versions class at composer install/update time containing the resolved versions from composer.lock, then serves them at runtime with no IO.
  • For a Laravel application, that means the integration surface is zero: the only architectural touchpoint is the Composer lifecycle and a static class your code may call. It does not compete with or complement any Laravel subsystem.
  • Consequently, "fit" is peripheral. It is an ops/diagnostics convenience, not a product capability. A TPM should frame this as an internal developer-tooling dependency, not a feature enabler.

Integration feasibility

  • Installation is a one-line composer require samsonasik/package-versions, and the API is trivially small (getVersion, getShortVersion, getMajorVersion).
  • Two hard gates apply before any pilot:
    1. Composer 2.2+ allow-plugins — Composer now blocks plugins by default. The team must explicitly allow this plugin in composer.json, which is a governance/security decision, not a technical one.
    2. Namespace collision — it uses the same PackageVersions\Versions FQCN as ocramius/package-versions. Any transitive dependency that pulls the upstream package will conflict. This is the single largest integration hazard and must be confirmed via composer why ocramius/package-versions before adoption.

Technical risk

  • Abandonment risk is high. Last release 2016-07-21, 3 stars, 0 dependents, single maintainer. No security patching, no PHP 8 certification, no active issue triage. Treat it as effectively frozen.
  • Obsolescence risk is high. The upstream project was superseded by Composer 2's built-in Composer\InstalledVersions, which is shipped with Composer itself and requires no plugin, no allowlist, and no third-party dependency. On any modern stack, this package is strictly redundant.
  • Compatibility risk is medium. The PHP 5.6 constraint means it targets Laravel 5.x-era stacks. Modern Laravel (9/10/11) requires PHP 8.1+, where this package is untested and the plugin API contract has drifted.
  • Build-time fragility is inherent: the generated class reflects composer.lock at install time, so stale caches or partial deploys can surface incorrect version data.

Key questions

  • Does any code path actually need programmatic package version lookup, or is this speculative tooling?
  • What PHP and Composer versions are in production, and is Composer 2 already the standard?
  • Is ocramius/package-versions present anywhere in the dependency graph (direct or transitive)?
  • Who owns the fork, and what is the exit plan if it breaks on a PHP upgrade?
  • Is the real requirement "no runtime IO version lookup," which Composer 2 already satisfies natively?

Integration Approach

Stack fit

  • Legitimate only for legacy Laravel 5.x / PHP 5.6–7.x applications that cannot move to Composer 2. In that narrow window it delivers what it says: efficient, zero-IO version querying.
  • For any Laravel application on Composer 2 (which is nearly all current installs), the correct answer is do not adopt. Use Composer\InstalledVersions::getPrettyVersion() / getVersion() / getReference(), which are part of Composer's runtime API and need no plugin approval.

Migration path

  • Forward (adopt): add the plugin to allow-plugins, pin the exact version, and wrap calls behind a thin internal interface (e.g., App\Support\PackageVersionResolver) so call sites are insulated.
  • Backward (exit): replace the wrapper implementation with Composer\InstalledVersions, remove the dependency, and delete the allowlist entry. Because the API surface is three static methods, exit cost is measured in hours, not sprints — provided the wrapper is introduced at adoption time.
  • The exit plan should be written before adoption; for an unmaintained 2016 package this is non-negotiable.

Compatibility

  • Verify composer show samsonasik/package-versions resolves without conflicting with ocramius/package-versions.
  • Confirm the generated class regenerates correctly on every deploy artifact build (not just developer machines).
  • Test on the exact production PHP minor version; do not assume PHP 8 behavior from a PHP 5.6-era codebase.

Sequencing

  1. Validate need — audit the codebase for version-lookup requirements; if none, close the ticket.
  2. Confirm Composer version — if Composer 2, document the native alternative and stop.
  3. Collision check — inspect the lock file for ocramius/package-versions.
  4. Pilot — install behind the wrapper interface in one non-critical service; run CI and a staging deploy.
  5. Govern — add the allow-plugins entry with a code comment explaining the rationale and the exit trigger.
  6. Schedule review — put an explicit deprecation review on the roadmap tied to the next PHP major upgrade.

Operational Impact

Maintenance

  • Effectively zero upstream maintenance. No commits expected, no CVE response, no PHP 8+ guarantees. The owning team absorbs all future breakage. This is a long-tail liability that should be documented in the dependency register alongside the exit trigger.
  • Ongoing cost is low in steady state (the API is static and small) but spiky at PHP/Composer upgrades.

Support

  • Community-only, and the community is three stars and zero dependents — meaning essentially no one. There is no vendor, no SLA, and no realistic path to upstream fixes. Internal expertise must be the support model.

Scaling

  • Runtime scaling is a non-issue. The entire value proposition is that version data is baked into a generated class, so lookups are constant-time with no filesystem or network IO. At any request volume, the runtime cost is indistinguishable from reading a class constant.
  • Build scaling is fine as well — the plugin runs once per composer install, adding negligible time. There is no per-deploy or per-request overhead to model.

Failure modes

  • Plugin blocked — Composer 2.2+ refuses to execute it unless allowlisted, silently or loudly depending on configuration. Symptom: missing generated class.
  • Class collision — a transitive dependency installs ocramius/package-versions, producing duplicate definitions and fatals.
  • Stale generated class — vendor directory cached from a prior build reports versions that do not match the deployed lock file, producing misleading diagnostics during incidents.
  • PHP upgrade breakage — deprecations or fatal errors on modern PHP with no upstream remedy; forces an emergency migration to Composer\InstalledVersions.
  • Abandonment — no trigger event, just permanent inability to get fixes; risk materializes at the worst time (security or platform upgrade).

Ramp-up

  • Near-zero. The API is three static methods with obvious semantics, and the README is sufficient. A developer is productive in minutes. The real ramp-up cost is not the API but the organizational work: allowlisting a plugin, writing the wrapper, documenting the exit plan, and socializing why a 2016 abandoned package is in the build at all.

TPM recommendation

  • Default position: do not adopt; route to Composer\InstalledVersions on Composer 2.
  • Exception: a legacy PHP 5.6/Laravel 5.x application with a concrete, documented need and a written exit plan. In that case adopt narrowly, wrap behind an interface, pin the version, and attach a deprecation review to the next PHP upgrade milestone.
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.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk