Commit 2151058b by Arpit Jain

store locater

parent 7275a9e5
<?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);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment