hubhive/blog-central

Typed Laravel client and optional Inertia React starter for Blog Central.

Maintainers

Package info

github.com/bramato/blog-central-laravel

pkg:composer/hubhive/blog-central

Transparency log

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-08-28 07:29 UTC

This package is auto-updated.

Last update: 2026-08-30 13:53:23 UTC


README

hubhive/blog-central connects a Laravel application to a project hosted by Blog Central. It provides a typed PHP client and an optional, neutral Inertia React starter. Tokens remain on the server and Blog Central remains the only database for articles and editorial requests.

Requirements

  • PHP 8.3 or later
  • Laravel 13
  • Optional starter: Inertia 3, React 19, Tailwind CSS 4 and Wayfinder

Installation

composer require hubhive/blog-central:^0.1
php artisan blog-central:install --react

Add the published route file to routes/web.php after reviewing its host-owned owner or admin middleware:

require __DIR__.'/blog-central.php';

Then generate the route helpers and build the frontend:

php artisan wayfinder:generate
npm run build

Configuration

Store credentials only in local environment files or deployment secrets:

BLOG_CENTRAL_URL=https://blogcentral.hubhive.net
BLOG_CENTRAL_TOKEN=
BLOG_CENTRAL_REQUEST_TOKEN=
BLOG_CENTRAL_IMPORT_TOKEN=

Use a different project-scoped token for every website. The request and import variables fall back to the read token only when they are omitted, so production applications should configure dedicated least-privilege tokens.

Typed client

use HubHive\BlogCentral\Contracts\BlogCentralClientContract;
use HubHive\BlogCentral\Data\ArticleRequestInput;

$client = app(BlogCentralClientContract::class);

$articles = $client->articles(['locale' => 'it']);
$article = $client->article('welcome-to-our-journal', ['locale' => 'it']);
$request = $client->requestArticle(new ArticleRequestInput(
    brief: 'Explain the practical impact of passkeys for small Laravel teams.',
    length: 1400,
));
$history = $client->articleRequests(['status' => 'processing']);

The client retries only idempotent reads, caches localized reads using a key that contains a one-way token hash, and maps authentication, authorization, subscription-required (402), not-found, rate-limit, provider and invalid-payload failures to dedicated exceptions. A SubscriptionRequiredException includes the Blog Central billing URL when available.

React starter

blog-central:install --react publishes files without overwriting existing host files. Use --force only when you deliberately want to replace them. The starter includes:

  • public article list and detail;
  • editorial request form, remote history and polling status;
  • read-only connection status and billing banner when a domain entitlement expires;
  • route and controller stubs owned by the host application.

The starter never receives or edits credentials. Adapt the published pages to the host application's layout and visual identity.