FireEngineRed / smartystreets-laravel by scottconnerly

Laravel (PHP) SDK for using SmartyStreets geocoding.
41,488
6
17
Package Data
Maintainer Username: scottconnerly
Maintainer Contact: scott.connerly@fire-engine-red.com (Scott A Connerly)
Package Create Date: 2015-08-04
Package Last Update: 2023-09-22
Language: PHP
License: GPL-2.0
Last Refreshed: 2024-04-25 15:07:43
Package Statistics
Total Downloads: 41,488
Monthly Downloads: 40
Daily Downloads: 0
Total Stars: 6
Total Watchers: 17
Total Forks: 9
Total Open Issues: 3

smartystreets-laravel

Laravel (PHP) SDK for using SmartyStreets geocoding.

Only attempting Address Verify at this time; willing to accept pull requests that fill in the other functionalities too (Zipcode Verify, Autocomplete, and Address Extraction).

Example Usage

$response = SmartyStreets::addressQuickVerify(array(
    'street'=>'P.O. Box 1017',
    'city'=>'Havertown',
    'state'=>'PA',
));

Methods are available (addressAddToRequest && addressGetCandidates) to check multiple addresses with one POST, but addressQuickVerify only handles one address at a time.

Further API details, including request and response fields, available at SmartyStreets: https://smartystreets.com/docs/address

How to Install

Laravel 5.0 +

  1. Install the fireenginered/smartystreets-laravel package

    $ composer require fireenginered/smartystreets-laravel:dev-master
    
  2. Update config/app.php to activate SmartyStreets

    # Add `SmartyStreetsLaravelServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsServiceProvider',
    )
    
    # Add the `SmartyStreetsFacade` to the `aliases` array
    'aliases' => array(
        ...
        'SmartyStreets'  => 'FireEngineRed\SmartyStreetsLaravel\SmartyStreetsFacade',
    )
    
  3. Create the configuration file config/smartystreets.php:

    $ php artisan vendor:publish
    
  4. Configure your API credentials in the config file.

    'authId' 	=> 'raw ID here',
    'authToken'	=> 'raw token here',
    

Alternately, replace the values there with env() calls, and put the credentials in your .env file