LaravelPackages.net
Acme Inc.
Toggle sidebar
think.studio/laravel-loqate-api

Loqate api integration for laravel

491
0
1.1.0
About think.studio/laravel-loqate-api

think.studio/laravel-loqate-api is a Laravel package for loqate api integration for laravel. It currently has 0 GitHub stars and 491 downloads on Packagist (latest version 1.1.0). Install it with composer require think.studio/laravel-loqate-api. Discover more Laravel packages by think.studio or browse all Laravel packages to compare alternatives.

Last updated

Laravel: Loqate API integration

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Installation

You can install the package via composer:

composer require think.studio/laravel-loqate-api

Configuration in .env

// config/services.php
'loqate' => [
    'key'    => env('LOQATE_API_KEY'),
],
LOQATE_API_KEY="AA11-AA11-AA11-AA11"

Usage

Simple call

LaravelLoqate\Loqate::captureInteractiveFind()->setText('CT15 5LS')->setIsMiddleware()->call()->json();

Set you api class

use LaravelLoqate\APIs\AbstractAPI;

class MyCaptureInteractiveFind extends AbstractAPI {

    /**
     * @inheritDoc
     */
    public function basePath(): string {
        return 'Capture/Interactive/Find/v1.1';
    }
}

$response = LaravelLoqate\Loqate::api(MyCaptureInteractiveFind::class)->setRequestField('Text', 'CT15 5LS')->setRequestField('IsMiddleware', true)->call();

$response->json('Items');

You can also specify your response wrapper (extends AbstractResponse)

Credits

  • Think Studio

Star History Chart