PHP code example of lase-peco / unit-converter

1. Go to this page and download the library: Download lase-peco/unit-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lase-peco / unit-converter example snippets

 php 
php artisan vendor:publish --provider="LasePeCo\UnitConverter\ServiceProvider"
 php

namespace App\Units;
use LasePeCo\UnitConverter\Units\Area as BaseArea;

class Area extends BaseArea
{
    public const SquareKiloMeter = 'km^2';
}
 php
use LasePeCo\UnitConverter\Facades\Converter;

Converter::getSupportedSystems(); 

// return

 [
  'metrics'  => 'Metrics',
  'uk'       => 'UK',
  'us_feet'  => 'US feet',
  'us_yards' => 'US yards'
 ]