<?php

namespace App\Helpers;
use GuzzleHttp\Client;


Trait Apihelpers
{
    
    
    public function call_api($locatorID=null,$api_url=null)
    {
        $client = new Client();
        $response = $client->request('GET', $api_url.$locatorID,[ 'headers' => [
            'Accept'     => 'application/json',
            'Authorization'  => getenv('API_KEY')]
        ]);
    	$statusCode = $response->getStatusCode();
        $body = $response->getBody()->getContents();
        return $locationDetailAPIdata = json_decode($body);
    }

}