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

Unit Converter Laravel Package

jordanbrauer/unit-converter

A PHP library for converting between units of measurement—length, mass, volume, temperature, speed, area and more—with a clean fluent API, automatic unit resolution, and support for registering custom units. Framework-agnostic with no dependencies.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping for any "measurement-aware" surface area. This package is the cheap enabler for things like: unit toggles on a product/listing page (metric ↔ imperial), recipe or ingredient scaling, fitness/training logs, shipping weight & dimension entry, lab or IoT sensor readings, real-estate square footage, and CSV/API ingestion where partners send mixed units. If a roadmap item contains the phrase "users should be able to enter or view this in their preferred units," this package is a candidate dependency for that line item.
  • Build vs. buy for a commodity capability. Unit conversion is a solved, low-differentiation problem. The PM decision is not "how do we convert metres to feet" — it's "do we spend engineer-days building and maintaining a conversion table, or do we absorb a small dependency?" This package pushes the answer toward the latter, which is usually correct for the ~20 standard measurement families it covers.
  • Normalization strategy for data models. A recurring product decision is where canonical units live: convert at the boundary (on ingest/display) and store one canonical unit, or store whatever the user typed plus a unit code. This package is a practical argument for "store canonical + display raw," because conversion is cheap and reversible, which simplifies reporting, sorting, filtering, and cross-tenant analytics.
  • Localization / market expansion sequencing. Supporting imperial and metric properly is a prerequisite for US/UK/EU/APAC rollout of any physical-goods or fitness product. This is a low-effort way to de-risk an internationalization milestone without committing to a full i18n program.
  • Custom/domain unit extensions. The package's registry/bootstrapping model means domain-specific units (e.g., a business-specific packaging size, a proprietary "credit" or "serving" measure) can be added without forking. That's a real product lever for vertical-specific offerings, but validate it in a spike before committing it to a roadmap.

When to Consider This Package

Adopt when most of these hold:

  • You're on PHP/Laravel, the conversion need is standard physical units (length, mass, volume, area, speed, temperature, time, pressure, energy, etc.), and you need it server-side — validation, normalization on write, API response shaping, imports, or report generation.
  • You want a framework-native feel: service provider + UnitConverter facade means low onboarding cost for a Laravel team; conversion reads as a one-liner rather than a bespoke utility class.
  • Conversion is a supporting capability, not the product. If nobody's job depends on conversion precision for regulated use, the accuracy bar is "obviously correct," which this clears for common units.
  • You need it inside a small number of call sites and can wrap it behind your own interface (see below).

Look elsewhere — or just write ~50 lines yourself — when:

  • Dependency risk matters more than convenience. The signals here are weak: no meaningful star count, no dependents, and a score of 0 in this snapshot. That is not proof of poor quality, but it is proof of a thin maintenance and community safety net. Treat it as a single-maintainer dependency. If your org gates on maintenance status, adoption breadth, or security-response SLAs, this will not clear the bar.
  • You need audit-grade or regulated accuracy — pharma dosing, financial/scientific metrology, safety-critical engineering. You want a vetted, versioned, tested-against-standards source, not a general-purpose helper.
  • You're heaviest on the frontend. If conversion is purely a UI concern (unit toggle that never leaves the browser), a small JS utility avoids shipping a PHP dependency and a round trip.
  • Your unit surface is exotic — currency (rates, not ratios), non-linear scales beyond temperature, historical/regional units, or arbitrary compound units. Verify coverage explicitly against your actual unit list before committing; do not assume.
  • The need is a one-off. A single conversion in one controller does not justify a package, a config file, and the vendor-review conversation. Buy the dependency only when the call sites are plural and growing.

How to Pitch It (Stakeholders)

To executives: This is a small, cheap dependency that lets us ship unit-aware features — metric/imperial toggles, mixed-unit imports, consistent reporting — without spending engineering time building a conversion table from scratch. It removes a recurring blocker from our internationalization and physical-goods roadmap at roughly the cost of a code review. The honest caveat: it's a low-adoption, single-maintainer open-source library, so we should treat it as a replaceable component rather than a foundation — wrap it behind our own interface so we can swap or replace it in a day if it goes stale. Net recommendation: adopt narrowly, budget half a day of engineering to insulate it, revisit if usage spreads beyond a handful of call sites.

To engineering: Laravel-native — service provider and facade, so it fits our conventions and reads well (convert($value)->from(...)->to(...)). It covers the standard measurement families and lets us register domain-specific units instead of forking. Two asks: (1) put it behind our own UnitConverter-style contract so no business logic imports the vendor namespace directly, and (2) pin the version and add coverage tests against a fixture table of known-good conversions, because we can't count on upstream to catch regressions for us. If either ask is rejected, build the thin internal utility instead — the functionality is not deep.

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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle