Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
namespace Customize\Service\WordPress;
use GuzzleHttp\Client;
abstract class AbstractService
private $client;
public function __construct(Client $client)
$this->client = $client;
public function getPosts()
$response = $this->client->get("wp-json/wp/v2/posts");
return json_decode($response->getBody(), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment