Download the PHP package clevyr/laravel-geocoder without Composer
On this page you can find all versions of the php package clevyr/laravel-geocoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clevyr/laravel-geocoder
More information about clevyr/laravel-geocoder
Files in clevyr/laravel-geocoder
Package laravel-geocoder
Short Description Handles geocoding an address into lat/lng with multiple providers
License MIT
Homepage https://github.com/clevyr/laravel-geocoder
Informations about the package laravel-geocoder
Laravel Geocoder
Handles geocoding an address into lat/lng based on cloud providers.
Note: Currently only supports using Google as a Geocoding provider. As we prioritize it, we will implement MapBox as well.
Installation
You can install the package via composer:
Next, publish the plugin assets:
This is the contents of the published config file (without descriptive comments):
Set up Google Geocoding
First, you need to set up a Google Geocoding API Key
Then, you will need to set the following ENV variable in your Laravel application:
Usage
Alternatively, you can include the Geocodable
trait in your Laravel Eloquent model
to get some nice geocoding instance methods:
`
Modifying the Model Geolocation Fields
By default, when you use the Geocodable
trait, Laravel Geocoder will default
to using the following fields on your model:
address_line_1
(Required)address_line_2
city
(Required)state
(Required)postal_code
(Required)country
(Defaults to 'US')
However, you can modify these fields on a per-model basis using the following getter functions in your model:
This would assume that there is a zip
field on this model, which will then be
used for this model's geolocation. Here are the full list of getter functions
that you can override:
Testing
Linting
Laravel Pint
Laravel Pint is an opinionated PHP code style fixer for minimalists.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Aaron Krauss
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-geocoder with dependencies
spatie/laravel-package-tools Version ^1.9.2
illuminate/contracts Version ^9.0