A workflow for publishing content in Laravel applications.
plank/publisher is a Laravel package for a workflow for publishing content in laravel applications..
It currently has 4 GitHub stars and 5.374 downloads on Packagist (latest version v13.11.5).
Install it with composer require plank/publisher.
Discover more Laravel packages by plank
or browse all Laravel packages to compare alternatives.
Last updated
Publisher is a Laravel package that provides a complete content publishing workflow, allowing you to maintain both published and draft versions of your content simultaneously. Editors can work on changes without affecting the live published version until changes are explicitly published.
Install the package via composer:
composer require plank/publisher
Add the Publishable interface and IsPublishable trait to your models:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Plank\Publisher\Concerns\IsPublishable;
use Plank\Publisher\Contracts\Publishable;
class Post extends Model implements Publishable
{
use IsPublishable;
}
Run the install command:
php artisan publisher:install
Add the publisher columns to your model if you did not generate them automatically:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends SnapshotMigration
{
public function up()
{
Schema::table('posts', function (Blueprint $table) {
$table->string('status');
$table->boolean('has_been_published');
$table->boolean('should_delete');
$table->json('draft')->nullable();
});
}
}
Run migrations:
php artisan migrate
For complete documentation including configuration, features, and advanced usage, see the Documentation.
Quick Links:
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
If you discover a security vulnerability within Publisher, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
Plank focuses on impactful solutions that deliver engaging experiences to our clients and their users. We're committed to innovation, inclusivity, and sustainability in the digital space. Learn more about our mission to improve the web.