This package makes it easy to interact with the Ghost Content API.
This package requires PHP >= 5.5.
You can install the package via composer:
composer require m1guelpf/ghost-api
You must pass a Guzzle client and the API token to the constructor of M1guelpf\GhostAPI\Ghost
.
$ghost = new \M1guelpf\GhostAPI\Ghost('YOUR_API_TOKEN');
or you can skip the token and use the connect()
method later
$ghost = new \M1guelpf\GhostAPI\Ghost();
$ghost->connect('YOUR_GHOST_API_TOKEN');
$ghost->getPosts($include, $fields, $filter, $limit, $page, $order, $format);
$ghost->getPost($id);
$ghost->getPostBySlug($slug);
$ghost->getPages($include, $fields, $filter, $limit, $page, $order, $format);
$ghost->getPage($id);
$ghost->getPageBySlug($slug);
$ghost->getAuthors($include, $fields, $filter, $limit, $page, $order);
$ghost->getAuthor($id);
$ghost->getAuthorBySlug($slug);
$ghost->getTags($include, $fields, $filter, $limit, $page, $order);
$ghost->getTag($id);
$ghost->getTagBySlug($slug);
$ghost->getClient();
$client = new \GuzzleHttp\Client(); // Example Guzzle client
$ghost->setClient($client);
where $client is an instance of \GuzzleHttp\Client
.
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License. Please see License File for more information.