Giter Site home page Giter Site logo

karam-mustafa / laravel-geographical-calculator Goto Github PK

View Code? Open in Web Editor NEW
408.0 6.0 24.0 490 KB

laravel package helps you to implement geographical calculation, with several algorithms that help you deal with coordinates and distances.

License: MIT License

PHP 100.00%
laravel package laravel-package laravel-geolocation geolocation geogra geographical-calculator geometry geocoder geocoder-library

laravel-geographical-calculator's Introduction

logo

Geographical Calculator

License PHP Composer Check & fix styling Run tests Code Quality

Geographical Calculator was developed for laravel 5.8+ to help you to implement geographical calculation, with With several algorithms that help you deal with coordinates.

Installation

1 - Dependency

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running:

composer require kmlaravel/laravel-geographical-calculator
2 - Copy the package providers to your local config with the publish command, this will publish the config:
php artisan geo:install

Features

config options

add your custom units,keys ..etc.

    /*
    |--------------------------------------------------------------------------
    | units values
    |--------------------------------------------------------------------------
    | your custom units, the initial units its convert from a mile to any value
    | (1.609344) is the conversion factor from a mile to a kilometer
    */
    'units' => [
        'mile' => 1,
        'km' => 1.609344,
        'm' => (1.609344 * 1000),
        'cm' => (1.609344 * 100),
        'mm' => (1.609344 * 1000 * 1000),
    ],

    /*
    |--------------------------------------------------------------------------
    | distance_key_prefix
    |--------------------------------------------------------------------------
    | if you declared more than tow points to resolve their distance,
    | you will see the result in the following format:
    | "1-2" => ["km" => "some result"],
    | "2-3" => ["km" => "some result"],
    | "3-4" => ["km" => "some result"],
    | and if you want to set any prefix before each index
    | you must change the below value to any value you want.
    |
    */
    'distance_key_prefix' => '',

Changelog

Please see the CHANGELOG for more information about what has changed or updated or added recently.

Security

If you discover any security related issues, please email them first to [email protected], if we do not fix it within a short period of time please open a new issue describing your problem.

Credits

karam mustafa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.