Download the PHP package novius/laravel-publishable without Composer
On this page you can find all versions of the php package novius/laravel-publishable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download novius/laravel-publishable
More information about novius/laravel-publishable
Files in novius/laravel-publishable
Package laravel-publishable
Short Description A Laravel Eloquent model trait for publishable resource
License AGPL-3.0-or-later
Homepage https://github.com/novius/laravel-publishable
Informations about the package laravel-publishable
Laravel Publishable
Introduction
A package for making Laravel Eloquent models "publishable" using 4 states : draft, published, unpublished and scheduled.
Manage an additional published_first_at
date for order by and display.
Requirements
- Laravel >= 10.0
- PHP >= 8.2
NOTE: These instructions are for Laravel >= 10.0 and PHP >= 8.2 If you are using prior version, please see the previous version's docs.
Installation
You can install the package via composer:
Usage
Migrations
Eloquent Model Trait
Extensions
The extensions shipped with this trait include; notPublished
, published
, onlyDrafted
, onlyExpired
, onlyWillBePublished
and can be used accordingly:
When not specifing any additional scopes, all not published models are excluded from the query by default to prevent leaks of not published data.
Testing
CS Fixer
Lint your code with Laravel Pint using:
Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.
All versions of laravel-publishable with dependencies
illuminate/support Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0