Skip to content

plank/publisher

Repository files navigation

PHP Version Support Laravel Version Support GitHub Workflow Status

Laravel Publisher

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.

Installation

  1. Install the package via composer:

    composer require plank/publisher
  2. 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;
    }
  3. Run the install command:

    php artisan publisher:install
  4. 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();
            });
        }
    }
  5. Run migrations:

    php artisan migrate

Documentation

For complete documentation including configuration, features, and advanced usage, see the Documentation.

Quick Links:

 

Contributing

Please see CONTRIBUTING for details.

 

Credits

 

License

The MIT License (MIT). Please see License File for more information.

 

Security Vulnerabilities

If you discover a security vulnerability within Publisher, please send an e-mail to security@plank.co. All security vulnerabilities will be promptly addressed.

 

Check Us Out!

 

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.

About

A workflow for publishing content in Laravel applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages