PHPackages                             julienbourdeau/laravel-ghost-connector - 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. [Database &amp; ORM](/categories/database)
4. /
5. julienbourdeau/laravel-ghost-connector

ActiveLibrary[Database &amp; ORM](/categories/database)

julienbourdeau/laravel-ghost-connector
======================================

Use your Ghost posts as if they were Eloquent models from your DB. Thanks to Sushi and the Ghost API!

0.3.0(6y ago)3121MITPHPPHP ^7.1CI failing

Since Apr 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/julienbourdeau/laravel-ghost-connector)[ Packagist](https://packagist.org/packages/julienbourdeau/laravel-ghost-connector)[ Docs](https://github.com/julienbourdeau/laravel-ghost-connector)[ RSS](/packages/julienbourdeau-laravel-ghost-connector/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Laravel Ghost connector
=======================

[](#laravel-ghost-connector)

[![Laravel](https://github.com/julienbourdeau/laravel-ghost-connector/workflows/Laravel/badge.svg)](https://github.com/julienbourdeau/laravel-ghost-connector/workflows/Laravel/badge.svg)[![Latest Version on Packagist](https://camo.githubusercontent.com/663ba8e231fee8a4bab02fcf0856bcbbbe7e96261bb10581ca454e4dcd09488d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a756c69656e626f7572646561752f6c61726176656c2d67686f73742d636f6e6e6563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/julienbourdeau/laravel-ghost-connector)

This package retrieve content from a Ghost blog and make it available as a regular model using [Sushi](https://github.com/calebporzio/sushi).

The content will be kept in memory and reused anytime you call the model builder. It's not shared between requests.

I wrote this package because I built my custom blog on Laravel, with Laravel Nova. I like it for long articles but for journaling, I found the writing experience not so nice. With this package, I write in Ghost admin, but the content is still published via Laravel. 🏄‍♂️

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

[](#installation)

You can install the package via composer:

```
composer require julienbourdeau/laravel-ghost-connector
```

Add your Ghost credentials in our `.env`.

```
GHOST_API_URL=http://localhost:2369
GHOST_CONTENT_KEY=2b3934d798ccce67daacdc8adb
```

Usage
-----

[](#usage)

Here are a few simple example how you'd typically use this package. The following code will make **one single HTTP call to Ghost**.

```
Post::count();
Post::all()->map(function($x) {
    dump($x->title);
});
Post::where('featured', true)->get();
```

```
@foreach (Post::all() as $post)
  {{ $post->title }}
  {{ nl2br($post->excerpt) }}

@endforeach
```

### Ghost API

[](#ghost-api)

When retrieving the posts from Ghost, the package will [include tags and authors](https://ghost.org/docs/api/v3/content/#posts).

Content is also casted, using the regular `$casts` Model feature.

#### Example

[](#example)

[This is the API response](https://github.com/julienbourdeau/laravel-ghost-connector/blob/master/tests/fixtures/posts.json) and the following is `Post::first()->toArray()`.

```
array:34 [
  "id" => "5e80568dc50444aef65bea46"
  "uuid" => "97f42901-6b26-4a61-9ec6-96852d05e0f3"
  "title" => "Welcome to Ghost"
  "slug" => "welcome"
  "html" => "A few things you should knowGhost is
 designed for ambitious ... Blah blah blah"
  "comment_id" => "5e80568dc50444aef65bea46"
  "feature_image" => "https://static.ghost.org/v3.0.0/images/welcome-to-ghost.png"
  "featured" => false
  "visibility" => "public"
  "send_email_when_published" => false
  "created_at" => "2020-03-29T08:04:29.000000Z"
  "updated_at" => "2020-03-29T08:04:29.000000Z"
  "published_at" => "2020-03-29T08:04:35.000000Z"
  "custom_excerpt" => """
    Welcome, it's great to have you here.\n
    We know that first impressions are important, so we've populated your new site with some initial getting started posts that will help you get familiar with everything in no time.
    """
  "codeinjection_head" => null
  "codeinjection_foot" => null
  "custom_template" => null
  "canonical_url" => null
  "authors" => array:1 [
    0 => array:13 [
      "id" => "5951f5fca366002ebd5dbef7"
      "name" => "Ghost"
      "slug" => "ghost"
      "profile_image" => "https://static.ghost.org/v3.0.0/images/ghost.png"
      "cover_image" => null
      "bio" => "You can delete this user to remove all the welcome posts"
      "website" => "https://ghost.org"
      "location" => "The Internet"
      "facebook" => "ghost"
      "twitter" => "ghost"
      "meta_title" => null
      "meta_description" => null
      "url" => "http://localhost:2369/author/ghost/"
    ]
  ]
  "tags" => array:1 [
    0 => array:9 [
      "id" => "5e80568cc50444aef65be9e6"
      "name" => "Getting Started"
      "slug" => "getting-started"
      "description" => null
      "feature_image" => null
      "visibility" => "public"
      "meta_title" => null
      "meta_description" => null
      "url" => "http://localhost:2369/tag/getting-started/"
    ]
  ]
  "primary_author" => array:13 [
    "id" => "5951f5fca366002ebd5dbef7"
    "name" => "Ghost"
    "slug" => "ghost"
    "profile_image" => "https://static.ghost.org/v3.0.0/images/ghost.png"
    "cover_image" => null
    "bio" => "You can delete this user to remove all the welcome posts"
    "website" => "https://ghost.org"
    "location" => "The Internet"
    "facebook" => "ghost"
    "twitter" => "ghost"
    "meta_title" => null
    "meta_description" => null
    "url" => "http://localhost:2369/author/ghost/"
  ]
  "primary_tag" => array:9 [
    "id" => "5e80568cc50444aef65be9e6"
    "name" => "Getting Started"
    "slug" => "getting-started"
    "description" => null
    "feature_image" => null
    "visibility" => "public"
    "meta_title" => null
    "meta_description" => null
    "url" => "http://localhost:2369/tag/getting-started/"
  ]
  "url" => "http://localhost:2369/welcome/"
  "excerpt" => """
    Welcome, it's great to have you here.\n
    We know that first impressions are important, so we've populated your new site with some initial getting started posts that will help you get familiar with everything in no time.
    """
  "reading_time" => 1
  "og_image" => null
  "og_title" => null
  "og_description" => null
  "twitter_image" => null
  "twitter_title" => null
  "twitter_description" => null
  "meta_title" => null
  "meta_description" => null
  "email_subject" => null
]

```

### 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)

- [Julien Bourdeau](https://github.com/julienbourdeau)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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 ~0 days

Total

3

Last Release

2228d ago

### Community

Maintainers

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

---

Top Contributors

[![julienbourdeau](https://avatars.githubusercontent.com/u/1525636?v=4)](https://github.com/julienbourdeau "julienbourdeau (7 commits)")

---

Tags

ghostghost-bloglaravellaravel-packagelaravel-sushisushijulienbourdeaularavel-ghost-connector

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[plank/laravel-mediable

A package for easily uploading and attaching media files to models with Laravel

8271.5M11](/packages/plank-laravel-mediable)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)

PHPackages © 2026

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