All Projects → salmanzafar949 → laravel-geocode

salmanzafar949 / laravel-geocode

Licence: MIT license
Laravel Package to find Lat and Long of a given Address

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-geocode

nova-rating-field
A Star rating field to use in your Laravel Nova apps.
Stars: ✭ 42 (+180%)
Mutual labels:  laravel-package
trader
Laravel package for trader extension interface.
Stars: ✭ 43 (+186.67%)
Mutual labels:  laravel-package
jwt-auth
🔐 JSON Web Token Authentication for Laravel & Lumen
Stars: ✭ 525 (+3400%)
Mutual labels:  laravel-package
boilerplate
Laravel AdminLTE 3 Boilerplate package with blade components, users, roles and permissions management
Stars: ✭ 167 (+1013.33%)
Mutual labels:  laravel-package
LaravelPostcodes
A service wrapper around postcodes.io
Stars: ✭ 73 (+386.67%)
Mutual labels:  laravel-package
laravel-jwt
A seamless JWT implementation for Laravel
Stars: ✭ 71 (+373.33%)
Mutual labels:  laravel-package
Translation Sheet
Translating Laravel languages files using a Google Spreadsheet.
Stars: ✭ 254 (+1593.33%)
Mutual labels:  laravel-package
relations-widgets-for-backpack
Views/widgets for preview laravel relations in laravel backpack
Stars: ✭ 21 (+40%)
Mutual labels:  laravel-package
laravel-migrate-check
An artisan command to check for pending migrations with proper exit code
Stars: ✭ 53 (+253.33%)
Mutual labels:  laravel-package
Laravel-Youtube-API
A way to add an API to your Laravel app that converts youtube video's to mp3/mp4 and returns a download/stream link and information.
Stars: ✭ 19 (+26.67%)
Mutual labels:  laravel-package
formoj
Form generator package for Laravel
Stars: ✭ 28 (+86.67%)
Mutual labels:  laravel-package
laravel-packages
Useful packages for Laravel projects
Stars: ✭ 22 (+46.67%)
Mutual labels:  laravel-package
laravel-api-tool-kit
Laravel api tool kit is a set of tools that will help you to build a fast and well-organized API using laravel best practices.
Stars: ✭ 107 (+613.33%)
Mutual labels:  laravel-package
Instagram-for-PHP
PHP SDK for Instagram API
Stars: ✭ 82 (+446.67%)
Mutual labels:  laravel-package
laravel-two-factor-authentication
A two-factor authentication package for Laravel >= 8
Stars: ✭ 37 (+146.67%)
Mutual labels:  laravel-package
madzipper
Wannabe successor of Chumper/Zipper package for Laravel
Stars: ✭ 114 (+660%)
Mutual labels:  laravel-package
openfoodfacts-laravel
Open Food Facts API wrapper for Laravel
Stars: ✭ 117 (+680%)
Mutual labels:  laravel-package
laravel-cache
An improved helper for working with cache
Stars: ✭ 64 (+326.67%)
Mutual labels:  laravel-package
flash
An easy way for Laravel flash notifications.
Stars: ✭ 14 (-6.67%)
Mutual labels:  laravel-package
unobserve
Mute and unmute Laravel observers at will.
Stars: ✭ 82 (+446.67%)
Mutual labels:  laravel-package

laravel-geocode

stars issues forks license Total Downloads

Laravel Package to get Lat and Long from Specific Address.

Table of contents

Installation

composer require salmanzafar/laravel-geocode

Configuration

Publish the configuration file

php artisan vendor:publish --provider="Salman\GeoCode\GeoCodeServiceProvider"

Config/geocode.php

'API_KEY' => env('GOOGLE_GEOCODE_API_KEY', ''),

Enable the package (Optional)

This package implements Laravel auto-discovery feature

Usage

You need a Google map geocode api key in order to use this

Finding Coordinates

use Salman\GeoCode\Services\GeoCode;

public function lookForPoints()
{
        $address = "1600 Amphitheatre Parkway,Mountain View";
        $getPoints = new GeoCode();
        return $getPoints->getLatAndLong($address); 
}

Finding Coordinates using Facade

use GeoCode;

public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return GeoCode::getLatAndLong($address); 
}

Finding Coordinates using Helper Function

public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return findAddressCoordinates($address); 
}

Response

It will return a Laravel collection as response
{
    "address_components": [
        {
            "long_name": "1600",
            "short_name": "1600",
            "types": [
                "street_number"
            ]
        },
        {
            "long_name": "Amphitheatre Parkway",
            "short_name": "Amphitheatre Pkwy",
            "types": [
                "route"
            ]
        },
        {
            "long_name": "Mountain View",
            "short_name": "Mountain View",
            "types": [
                "locality",
                "political"
            ]
        },
        {
            "long_name": "Santa Clara County",
            "short_name": "Santa Clara County",
            "types": [
                "administrative_area_level_2",
                "political"
            ]
        },
        {
            "long_name": "California",
            "short_name": "CA",
            "types": [
                "administrative_area_level_1",
                "political"
            ]
        },
        {
            "long_name": "United States",
            "short_name": "US",
            "types": [
                "country",
                "political"
            ]
        },
        {
            "long_name": "94043",
            "short_name": "94043",
            "types": [
                "postal_code"
            ]
        }
    ],
    "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
    "geometry": {
        "location": {
            "lat": 37.4220579,
            "lng": -122.0840897
        },
        "location_type": "ROOFTOP",
        "viewport": {
            "northeast": {
                "lat": 37.42340688029149,
                "lng": -122.0827407197085
            },
            "southwest": {
                "lat": 37.4207089197085,
                "lng": -122.0854386802915
            }
        }
    },
    "place_id": "ChIJtYuu0V25j4ARwu5e4wwRYgE",
    "plus_code": {
        "compound_code": "CWC8+R9 Mountain View, CA, USA",
        "global_code": "849VCWC8+R9"
    },
    "types": [
        "street_address"
    ]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].