PHPackages                             igorsgm/laravel-ghost - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. igorsgm/laravel-ghost

ActiveLibrary

igorsgm/laravel-ghost
=====================

👻• A Laravel wrapper that allows you to access Ghost APIs (Content &amp; Admin). Access, create and manage your Ghost content from you app!

1.1.0(2y ago)12863↓100%6[1 PRs](https://github.com/igorsgm/laravel-ghost/pulls)MITPHPPHP ^7.4|^8.0

Since Jun 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/igorsgm/laravel-ghost)[ Packagist](https://packagist.org/packages/igorsgm/laravel-ghost)[ Docs](https://github.com/igorsgm/laravel-ghost)[ RSS](/packages/igorsgm-laravel-ghost/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (7)Used By (0)

 [![Laravel Ghost](https://raw.githubusercontent.com/igorsgm/laravel-ghost/master/logo.png)](https://raw.githubusercontent.com/igorsgm/laravel-ghost/master/logo.png)

A Laravel wrapper that allows you to access [Ghost APIs](https://ghost.org/docs/content-api/ "Ghost Content API Documentation") ([Content](https://ghost.org/docs/content-api/ "Ghost Content API Documentation") &amp; [Admin](https://ghost.org/docs/admin-api/ "Ghost Admin API Documentation")). Access, create and manage your Ghost content from you app!

 [ ![Latest Version on Packagist](https://camo.githubusercontent.com/4ad1f77e6ce04f1d6eaa93a9c19cb3700ed3862d94ed81cc1c37d5c3e7237ae2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69676f7273676d2f6c61726176656c2d67686f73742e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/igorsgm/laravel-ghost) [ ![Build Status](https://camo.githubusercontent.com/fcd45107051f4f7a96cea7ebcb2bfdceee565ab94e172d1c0d7707b79f6d4774/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69676f7273676d2f6c61726176656c2d6769742d686f6f6b732f6d61696e2e796d6c3f7374796c653d666c61742d737175617265) ](https://travis-ci.org/igorsgm/laravel-ghost)[ ![Tests Coverage](https://camo.githubusercontent.com/1f8c7af6c4416baa31e4639b93e6bd5161838760cdc4d1115db8b1c9b0a7961c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f69676f7273676d2f6c61726176656c2d67686f73742f6d61737465723f7374796c653d666c61742d737175617265) ](https://travis-ci.org/igorsgm/laravel-ghost) [ ![Quality Score](https://camo.githubusercontent.com/0f81d09c6873bef7ee456691d98c4710b45546a35a75f191278ef9d1f3cec3ac/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f69676f7273676d2f6c61726176656c2d67686f73742e7376673f7374796c653d666c61742d737175617265) ](https://scrutinizer-ci.com/g/igorsgm/laravel-ghost) [ ![Total Downloads](https://camo.githubusercontent.com/620e1b554d05160ef17b1f0a6d6e94476d7a6ef5d42e7d9eaa59b5e25dd5a290/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69676f7273676d2f6c61726176656c2d67686f73742e7376673f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/igorsgm/laravel-ghost)

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require igorsgm/laravel-ghost
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Igorsgm\Ghost\GhostServiceProvider" --tag="ghost-config"
```

---

Usage
-----

[](#usage)

#### Define Ghost API credentials at `ghost.php` config or in your `.env` file. i.e.:

[](#define-ghost-api-credentials-at-ghostphp-config-or-in-your-env-file-ie)

```
GHOST_ADMIN_DOMAIN=https://demo.ghost.io
GHOST_CONTENT_API_KEY=22444f78447824223cefc48062
GHOST_ADMIN_API_KEY=foo:bar

```

Content API
-----------

[](#content-api)

### 1) General Usage

[](#1-general-usage)

```
// Using the Facade (recommended), which will take the variables from the ghost.php config file
$contentApi = Ghost::content();
$response = $contentApi->posts()->all();

// Or you can set the variables manually
$contentApi = Ghost::content([
    'key' => '22444f78447824223cefc48062',
    'domain' => 'https://demo.ghost.io',
    'version' => 4
]);

$response = $contentApi->posts()->all();
$posts = $response->data;
$meta = $response->meta;
```

#### The Content API for `posts`, `pages`, `tags`, `authors`, `settings`, `tiers` are similiar and can be used with the following methods:

[](#the-content-api-for-posts-pages-tags-authors-settings-tiers-are-similiar-and-can-be-used-with-the-following-methods)

```
// All resources returned as SuccessResponse (or ErrorResponse)
Ghost::content()->posts()->all();
Ghost::content()->authors()->all();
Ghost::content()->tags()->all();
Ghost::content()->pages()->all();
Ghost::content()->settings()->all();
Ghost::content()->tiers()->all();
```

#### Single resource returned as Post, Author, Tag, Page or Tier

[](#single-resource-returned-as-post-author-tag-page-or-tier)

```
// Retrieve a single resource by slug
Ghost::content()->posts()->fromSlug('welcome');

// Retrieve first resource item
Ghost::content()->posts()->first();

// Retrieve a single resource by id
Ghost::content()->posts()->find('6285dbba44c5d85187a074ba');
```

#### Paginations

[](#paginations)

```
// Get paginated resources
Ghost::content()->posts()->paginate();
$response = Ghost::content()->posts()->paginate(15);

$posts = $response->data;
$meta = $response->meta;

// Browse between pages
$response->getNextPage();
$response->getPreviousPage();
```

#### Build your request

[](#build-your-request)

> Valid for both: Ghost::content() and Ghost::admin() APIs

```
Ghost::content()->posts()
    ->include('authors', 'tags') // https://ghost.org/docs/content-api/#include
    ->fields('title', 'slug', 'html') // https://ghost.org/docs/content-api/#fields
    ->formats('html') // https://ghost.org/docs/content-api/#formats
    ->filter('author:john+featured:true') // https://ghost.org/docs/content-api/#filtering
    ->limit(20) // https://ghost.org/docs/content-api/#limit
    ->page(2) // https://ghost.org/docs/content-api/#page
    ->orderBy('title', 'DESC') // https://ghost.org/docs/content-api/#order
    ->get();
```

Admin API
---------

[](#admin-api)

- All ContentAPI methods related to Post, Author, Tag, Page or Tier are also available in the Admin API.

ResourceMethods-&gt;posts()get, create, update, delete-&gt;pages()get, create, update, delete-&gt;tags()get, create, update, delete-&gt;tiers()get, create, update, delete-&gt;offers()get, create, update-&gt;members()get, create, update-&gt;users()get-&gt;images()upload-&gt;themes()upload, activate-&gt;site()get-&gt;webhooks()create, update, delete#### (Admin) Posts, Pages, Tags, Tiers, Offers, Members, Users, Webhooks

[](#admin-posts-pages-tags-tiers-offers-members-users-webhooks)

> The consume of these Admin APIs are similar and can be used with the following methods:

```
// Create post with mobiledoc source
Ghost::admin()->posts()->create([
    'title' => 'My Test Post',
    'mobiledoc' => '{"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"My post content. Work in progress..."]]]]}',
    'status' => 'published',
]);

// Create post with HTML source
Ghost::admin()->posts()->source('html')->create([
    'title' => 'My Test Post 2',
    'html' => 'My post content. Work in progress...',
    'status' => 'published',
]);

// Update resource with mobiledoc source
// The updated_at field is required as it is used to handle collision detection, and ensure you’re not overwriting more recent updates.
// It is recommended to perform a GET request to fetch the latest data before updating a resource.
$post = Ghost::admin()->posts()->find($id);
Ghost::admin()->posts()->source('html')->update($id, [
    'title' => 'My New Title',
    'html' => 'My post content updated. Work in progress...',
    'updated_at' => $post->updatedAt,
]);

// Delete resource by ID
Ghost::admin()->posts()->delete('6285dbba44c5d85187a074ba');
```

#### (Admin) Images, Themes

[](#admin-images-themes)

```
// Upload image
$imagePathOrUrl = 'https://picsum.photos/200';
$response = Ghost::admin()->images()->upload($imagePathOrUrl);

// Upload theme (.zip)
$zipPathOrUrl = 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-zip-file.zip';
$response = Ghost::admin()->themes()->upload($zipPathOrUrl);

// Activate a theme
Ghost::admin()->themes()->activate('theme-name');
```

---

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Igor Moraes](https://github.com/igorsgm)
- [Michael Messerli](https://github.com/messerli90)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Total

5

Last Release

1071d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfb997f2b3487c4c0bee305619750280ddcfd0707533296d0db532268382be8f?d=identicon)[igorsgm](/maintainers/igorsgm)

---

Top Contributors

[![igorsgm](https://avatars.githubusercontent.com/u/14129843?v=4)](https://github.com/igorsgm "igorsgm (93 commits)")

---

Tags

laravelcmsblogigorsgmGhostlaravel-ghost

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/igorsgm-laravel-ghost/health.svg)

```
[![Health](https://phpackages.com/badges/igorsgm-laravel-ghost/health.svg)](https://phpackages.com/packages/igorsgm-laravel-ghost)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M672](/packages/laravel-socialite)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[serverfireteam/blog

A nice blog system with laravel and laravelpanel

523.1k](/packages/serverfireteam-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
