PHPackages                             nehalpatel/unit-conversion - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nehalpatel/unit-conversion

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nehalpatel/unit-conversion
==========================

This is my package unit-conversion

1.3.2(3y ago)09[2 PRs](https://github.com/NehalPatel/unit-conversion/pulls)MITPHPPHP ^8.1

Since Mar 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/NehalPatel/unit-conversion)[ Packagist](https://packagist.org/packages/nehalpatel/unit-conversion)[ Docs](https://github.com/nehalpatel/unit-conversion)[ RSS](/packages/nehalpatel-unit-conversion/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (12)Versions (9)Used By (0)

Unit Conversion Package
=======================

[](#unit-conversion-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d0e83cbef777a8052202d3fb194d5dd761d82c897e2dfd87543055de0219a5b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6568616c706174656c2f756e69742d636f6e76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nehalpatel/unit-conversion)[![GitHub Tests Action Status](https://camo.githubusercontent.com/0562dca17371b7b353e00afedecfe479b255e37ce7addb1d77e068f6248155fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6568616c706174656c2f756e69742d636f6e76657273696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/nehalpatel/unit-conversion/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d5cf66d6900525b02b792fb1d97510b17948fba53c4adcc08857715eb68304d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6568616c706174656c2f756e69742d636f6e76657273696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/nehalpatel/unit-conversion/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b075dbb82c56319e234ce46484b785da2a2d583ba04fac17dc8e7a70df35c91e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6568616c706174656c2f756e69742d636f6e76657273696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nehalpatel/unit-conversion)

The package is collection of classes to convert the units to other format of units.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require nehalpatel/unit-conversion
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="unit-conversion-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="unit-conversion-config"
```

This is the contents of the published config file:

```
return [
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="unit-conversion-views"
```

Usage
-----

[](#usage)

```
use NehalPatel\UnitConversion\Temperature\Celsius;
use NehalPatel\UnitConversion\Temperature\Fahrenheit;
use NehalPatel\UnitConversion\Weight\Kilogram;

//convert from Celsius to Fahrenheit
UnitConversion::from(new Celsius(30))->toFahrenheit()->convert();
Celsius::from(20)->toFahrenheit()->convert();

//convert from Fahrenheit to Celsius
UnitConversion::from(new Fahrenheit(68))->toCelsius()->convert();
Fahrenheit::from(68)->toCelsius()->convert();

//Weight Conversion
UnitConversion::from(new Kilogram(10))->toGram()->convert();
Kilogram::from(10)->toGram()->convert();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Nehal Patel](https://github.com/NehalPatel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

1207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5576788cac134c9a8691e82819c862e25794f0385690658f3190ae24d44424?d=identicon)[nehalpatel](/maintainers/nehalpatel)

---

Top Contributors

[![NehalPatel](https://avatars.githubusercontent.com/u/1838272?v=4)](https://github.com/NehalPatel "NehalPatel (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelunit-conversionNehalPatel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nehalpatel-unit-conversion/health.svg)

```
[![Health](https://phpackages.com/badges/nehalpatel-unit-conversion/health.svg)](https://phpackages.com/packages/nehalpatel-unit-conversion)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/laravel-wallet

A simple wallet implementation for Laravel

26611.9k](/packages/stephenjude-laravel-wallet)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
