Replacd the API call impementation

This commit is contained in:
Olu Amey
2021-09-06 17:44:35 -04:00
parent e0ba4b9141
commit bb5590bebd
5 changed files with 557 additions and 186 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Services;
use GuzzleHttp\Client as HTTPClient;
class WpContentsClient
{
public static function serviceGetBlogItems($blogUrl)
{
$client = new HTTPClient();
$apiEndpointsConfig = $blogUrl; //"http://172.31.4.19:8000";
// $apiEndpointsConfig = config('ApiEndpoints');
$response = $client->request(
'GET',
"{$apiEndpointsConfig}/wordpress-data"
);
return json_decode($response->getBody());
}
}