jamal / unit-converter
This package converts different units.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=5.5.9
- laravel/framework: >=5.6
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