Download the PHP package plank/publisher without Composer

On this page you can find all versions of the php package plank/publisher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package publisher

PHP Version Support PHP Version Support GitHub Workflow Status

Laravel Publisher

:warning: Package is under active development. Wait for v1.0.0 for production use. :warning:

Publisher is a package aimed at providing a simple and flexible way to manage the publishing workflow of content in a Laravel application. It is designed to be used with any type of content, such as blog posts, pages, or any other type of content that may require a publishing workflow.

A key requirement Publisher aims to solve, is the ability to work on existing content without the changes being visible to your site's regular users until the changes are ready to be published, without the existing published version going missing from your site.

In Version 2+, Publisher will also provide the ability to manage relationships to content that is in a draft state without that related draft content being visible to your site's regular users.

Table of Contents

 

Installation

  1. You can install the package via composer:

  2. Add the Plank\Publisher\Concerns\IsPublishable trait and the Plank\Publisher\Contracts\Publishable interface to the models you want to respect the publishing workflow.

  3. Use the package's install command to complete the installation:

 

Configuration

The package's configuration file is located at config/publisher.php. If you did not publish the config file during installation, you can publish the configuration file using the following command:

Migration Columns

Each Publishable Model requires 3 columns on their table to function properly:

  1. workflow
    • The workflow columns stores the current state of the model. Whether is is currently published, or being worked on as a draft.
  2. draft
    • The draft column stores the working values of the attributes in a json column
  3. has_been_published
    • The has_been_published column stores a boolean value to indicate if the model has ever been published.

As a further note, you could in theory extend the values of the workflow column to include more states, such as "in_review". However, there are two important states that are required for the package to function properly: a "published" state, and an "unpublished" state. These states are configurable in the IsPublishable trait, by overriding the publishedState and unpublishedState methods.

Whenever a model is transitioned to the "published" state, the has_been_published column is set to true, and the model is considered to have been published.

Whenever a model is transitioned out of the "published" state, changes to the model's attributes will be persisted to the draft column, and the workflow column will be set to the "unpublished" state.

 

Middleware

The package provides a route middleware that can toggle the visiblity of draft content in the application. This is useful for allowing specific users to preview draft content in a production environment.

If you want to use the package's middleware globally, you should place it in your \App\Http\Kernel just before \Illuminate\Routing\Middleware\SubstituteBindings::class.

 

URL Rewriting

This package provides an opt-out feature which overrides all URL generation done by the frameworks methods like url() and route() to preserve the current visiblity of the draft content.

You can disable the feature by setting the urls.rewrite key to false in the configuration file.

You can also configure the GET query parameter used to signify the site should display draft content by setting the urls.previewKey key to the desired value.

When the value configured in previewKey is present in the GET query, AND the user has the Gate ability to view-draft-content, the package will allow draft content and rewrite all urls to include the previewKey.

 

Draft Paths

You can specify request path patterns for endpoints you wish to force draft content to be enabled on. This is especially important for your Admin Panel and CMS routes, as you will want to be working with unpublished content during the editing/creation process.

By default, this package defaults to the Plank's standard for using Laravel Nova with admin/*, nova-api/* and nova-vendor/* defined.

 

Gates & Abilities

All gates defined on the package can be overriden in your app by defining the gate with the same name in an Application Service Provider.

The package implementation of all gates is as follows:

publish

This gate is used to determine if a user has the ability to publish a model. By default, the gate is defined as follows:

unpublish

This gate is used to determine if a user has the ability to unpublish a model. By default, the gate is defined as follows:

view-draft-content

This gate is used to determine if a user has the ability to view draft content. By default, the gate is defined as follows:

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 siren, please send an e-mail to [email protected]. 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.


All versions of publisher with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10|^11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package plank/publisher contains the following files

Loading the files please wait ....