<?php

namespace App\Traits;
use GuzzleHttp\Client;


Trait Apitraits
{
    
    
    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,true);
    }

}