Search by

corpuscom / blost-laravel

sbolch

Ready-to-use Blost blog for Laravel

Package info

github.com/corpuscom/blost-laravel

pkg:composer/corpuscom/blost-laravel

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-23 00:13 UTC

This package is auto-updated.

Last update: 2026-10-23 00:14:36 UTC


README

Important

Distribution mirror — submit changes to corpuscom/blost-bundle. This repository is updated automatically. Direct changes to main are restricted to the sync automation.

A ready-to-use blog for Laravel 12 or 13, built on the shared Blost publishing API. It includes an Eloquent model, a publishable migration, the article publisher, and public Blade pages. PHP must meet your Laravel version's requirements.

Install

Install from Packagist in your application directory. Install the stable 1.x release:

composer require "corpuscom/blost-laravel:^1.0"

No repository clone, custom Composer repository, or project-wide minimum-stability change is needed. Composer installs the compatible stable shared bundle automatically.

If you used the previous local checkout instructions, remove that path repository with composer config --unset repositories.blost-laravel before running the installation command.

Composer discovers both providers automatically. No application model, controller, or publisher implementation is required. The model is Corpuscom\Blost\LaravelBlog\Post, backed by blost_posts on your default database connection. If you already set blost.publisher, that implementation takes precedence; remove that setting or set it to null to use the supplied publisher.

Generate a token with php -r 'echo bin2hex(random_bytes(32)), PHP_EOL;' and add it to your application's environment:

BLOST_TOKEN=replace_with_generated_token
APP_URL=https://your-site.example

Publish the migration, review it, then apply it:

php artisan vendor:publish --tag=blost-blog-migrations
php artisan migrate
php artisan route:list --path=blost/v1
php artisan route:list --path=blog

The migration creates a dedicated table; do not apply it over an existing unrelated blost_posts table. Configure your database through the application's usual Laravel configuration.

In Blost, connect the Symfony / Laravel connector to https://your-site.example/blost/v1 using the same token. Publish an article and visit its returned URL, normally https://your-site.example/blog/{uuid}. See the connection guide.

Customize

Publish configuration or templates only when you need to change them:

php artisan vendor:publish --tag=blost-config
php artisan vendor:publish --tag=blost-blog-config
php artisan vendor:publish --tag=blost-blog-views

The blog configuration is separate from the connector's token and publisher settings:

// config/blost-blog.php
return [
    'prefix' => 'news',
    'title' => 'Company news',
    'public' => true,
];

Templates can be overridden in resources/views/vendor/blost-blog/. The package views are layout, index, and show. They escape metadata and render editorial HTML directly. The stored language is Blost's original label; the HTML document uses the application's locale. Image URLs are referenced directly, without server-side downloads.

Named routes are blost.blog.index and blost.blog.show (parameter id). To render pages yourself, set public to false and provide your own blost.blog.show route before publishing articles. The built-in publisher uses that named route for absolute URLs. You can also configure an application publisher through blost.publisher.

Pages list 20 posts at a time. Future-dated posts remain hidden until their publication time. Read the package behavior guide for persistence and concurrency semantics.

Rebuild production caches after configuration or route changes:

php artisan config:cache
php artisan route:cache
php artisan view:cache

The connector uses bearer authentication outside the web middleware group. The read-only blog pages are public and stateless. Do not wrap connector requests in a database transaction middleware: the publisher must commit before acknowledging success.

Development

Make changes in corpuscom/blost-bundle. This repository is a distribution mirror, automatically synchronized from the monorepo's packages/laravel directory on main. Submit code changes and pull requests to the monorepo.