jamal/unit-converter

This package converts different units.

1.0.0 2018-11-07 08:31 UTC

This package is auto-updated.

Last update: 2024-09-28 06:01:09 UTC


README

A unit converter package for Laravel.

Getting Started

These instructions will get you intall the package in your Laravel application.

Prerequisites

You must have the following things:

PHP >= 5.5.9
Laravel >= 5.5

What this package offers

It supports the following types of measurement by default (more measurement types are still to come).

  • Length
    • Kilometers
    • Miles
    • Nautical Miles
    • Centimeters
  • Area Coming Soon!
  • Data Transfer Rates Coming Soon!
  • Digital Storage Coming Soon!
  • Energy (Power) Coming Soon!
  • Frequency Coming Soon!
  • Fuel Economy Coming Soon!
  • Mass (Weight) Coming Soon!
  • Plane Angle (Rotation) Coming Soon!
  • Pressure Coming Soon!
  • Speed Coming Soon!
  • Temperature Coming Soon!
  • Time Coming Soon!
  • Volume Coming Soon!

Installing

The only way to install this component is via Composer.

Say what the step will be

$ composer require jamal/unit-converter

Setup

Add the following in providers array in app.php file.

UnitConverter\UnitConverterServiceProvider::class

Add the following in the alias array in app.php file.

'UC' => UnitConverter\UnitConverterFacade::class

How to use

// this will convert kilometers to miles
UC::kilometers()->toMile(1)

// this will convert miles to kilometers
UC::Miles()->toKilometer(1)

// this will convert nautical miles to kilometers
UC::nauticalMiles()->toKilometer(1)

License

This project is licensed under the MIT License - see the LICENSE.md file for details