PHP code example of think.studio / laravel-loqate-api

1. Go to this page and download the library: Download think.studio/laravel-loqate-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

think.studio / laravel-loqate-api example snippets


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

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');

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