Spikkl API client wrapper for Laravel
spikkl/spikkl-php-laravel-client is a Laravel package for spikkl api client wrapper for laravel.
It currently has 0 GitHub stars and 1.072 downloads on Packagist (latest version v1.3.0).
Install it with composer require spikkl/spikkl-php-laravel-client.
Discover more Laravel packages by spikkl
or browse all Laravel packages to compare alternatives.
Last updated
Spikkl-php-laravel-client incorporates the Spikkl API into your Laravel or Lumen project.
Add Spikkl-php-laravel-client to your composer file via the composer require command:
$ composer require spikkl/spikkl-php-laravel-client:^1.0
Or add it to composer.json manually:
"require": {
"spikkl/spikkl-php-laravel-client": "^1.0"
}
Spikkl-php-laravel-client's service provider will be automatically registered using Laravel's auto-discovery feature.
Note: for Lumen you have to add the Spikkl facade and service provider manually to: bootstrap/app.php:
$app->withFacades(true, [ 'Spikkl\Laravel\Facades\Spikkl' => 'Spikkl' ]);
$app->register(Spikkl\Laravel\ServiceProvider::class);
You will only need to add the SPIKKL_API_KEY variable to your .env file.
SPIKKL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here you can see an example of just how simple this package is to use.
$results = Spikkl::api()->lookup('nld', '2611HB', '175', null);
$results = Spikkl::api()->reverse('nld', 4.354901, 52.012133);
Note: longitude and latitude values will be rounded to 9 decimal places.
For your convenience we have added the global spikkl() helper function. It is an easy shortcut to the Spikkl::api() facade accessor.
// Using facade accessor
$results = Spikkl::api()->lookup('nld', '2611HB', '175', null);
// Using global helper function
$results = spikkl()->lookup('nld', '2611HB', '175', null);
BSD (Berkeley Software Distribution) License. Copyright (c) 2020, Spikkl
Contact: www.spikkl.nl — [email protected]