Download the PHP package toin0u/geocoder-laravel without Composer

On this page you can find all versions of the php package toin0u/geocoder-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geocoder-laravel

Travis Scrutinizer Coveralls GitHub release Packagist

Geocoder for Laravel

If you still use Laravel 4, please check out the 0.4.x branch here.

Version 4.0.0 is a backwards-compatibility-breaking update. Please review this documentation, especially the Usage section before installing.

This package allows you to use Geocoder in Laravel 5.

Requirements

Installation

  1. Install the package via composer:

  2. If you are running Laravel 5.5 (the package will be auto-discovered), skip this step. Find the providers array key in config/app.php and register the Geocoder Service Provider:

  3. Optional I recommend adding the following lines to your composer.json file to prevent stale caches when upgrading or updating the package, both in your live and dev environments:

Configuration

Pay special attention to the language and region values if you are using them. For example, the GoogleMaps provider uses TLDs for region values, and the following for language values: https://developers.google.com/maps/faq#languagesupport.

Further, a special note on the GoogleMaps provider: if you are using an API key, you must also use set HTTPS to true. (Best is to leave it true always, unless there is a special requirement not to.)

See the Geocoder documentation for a list of available adapters and providers.

Dedicated Cache Store Recommended

To implement the dedicated cache store, add another redis store entry in config/database.php, something like the following:

You will also need to add an entry in config/cache.php to point to this redis database:

Finally, configure Geocoder for Laravel to use this store. Edit config/geocoder.php:

Disabling Caching on a Query-Basis

You can disable caching on a query-by-query basis as needed, like so:

Providers

If you are upgrading and have previously published the geocoder config file, you need to add the cache-duration variable, otherwise cache will be disabled (it will default to a 0 cache duration). The default cache duration provided by the config file is 999999999 seconds, essentially forever.

By default, the configuration specifies a Chain provider, containing the GoogleMaps provider for addresses as well as reverse lookups with lat/long, and the GeoIP provider for IP addresses. The first to return a result will be returned, and subsequent providers will not be executed. The default config file is kept lean with only those two providers.

However, you are free to add or remove providers as needed, both inside the Chain provider, as well as along-side it. The following is the default configuration provided by the package:

Adapters

By default we provide a CURL adapter to get you running out of the box. However, if you have already installed Guzzle or any other PSR-7-compatible HTTP adapter, you are encouraged to replace the CURL adapter with it. Please see the Geocoder Documentation for specific implementation details.

Customization

If you would like to make changes to the default configuration, publish and edit the configuration file:

Usage

The service provider initializes the geocoder service, accessible via the facade Geocoder::... or the application helper app('geocoder')->....

Geocoding Addresses

Get Collection of Addresses

Get IP Address Information

Reverse-Geocoding

Dumping Results

Dependency Injection

Upgrading

Anytime you upgrade this package, please remember to clear your cache, to prevent incompatible cached responses when breaking changes are introduced (this should hopefully only be necessary in major versions):

1.x to 4.x

Update your composer.json file:

The one change to keep in mind here is that the results returned from Geocoder for Laravel are now using the Laravel-native Collections class instead of returning an instance of AddressCollection. This should provide greater versatility in manipulation of the results, and be inline with expectations for working with Laravel. The existing AddressCollection methods should map straight over to Laravel's Collection methods. But be sure to double-check your results, if you have been using count(), first(), isEmpty(), slice(), has(), get(), or all() on your results.

Also, getProviders() now returns a Laravel Collection instead of an array.

Alert: if you have been using the getIterator() method, it is no longer needed. Simply iterate over your results as you would any other Laravel collection.

Deprecated:

Added: this version introduces a new way to create more complex queries:

0.x to 1.x

If you are upgrading from a pre-1.x version of this package, please keep the following things in mind:

  1. Update your composer.json file as follows:

  2. Remove your config/geocoder.php configuration file. (If you need to customize it, follow the configuration instructions below.)
  3. Remove any Geocoder alias in the aliases section of your config/app.php. (This package auto-registers the aliases.)
  4. Update the service provider entry in your config/app.php to read:

  5. If you are using the facade in your code, you have two options:

    1. Replace the facades Geocoder:: (and remove the corresponding use statements) with app('geocoder')->.
    2. Update the use statements to the following:
  6. Update your query statements to use ->get() (to retrieve a collection of GeoCoder objects) or ->all() (to retrieve an array of arrays), then iterate to process each result.

Troubleshooting

Changelog

https://github.com/geocoder-php/GeocoderLaravel/blob/master/CHANGELOG.md

Contributor Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

GeocoderLaravel is released under the MIT License. See the bundled LICENSE file for details.


All versions of geocoder-laravel with dependencies

PHP Build Version
Package Version
Requires geocoder-php/chain-provider Version ^4.0
geocoder-php/geo-plugin-provider Version ^4.0
geocoder-php/google-maps-provider Version ^4.0
guzzlehttp/psr7 Version *
http-interop/http-factory-guzzle Version ^1.0
illuminate/cache Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
php-http/curl-client Version *
php Version ^8.0
willdurand/geocoder Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package toin0u/geocoder-laravel contains the following files

Loading the files please wait ....