PHPackages                             bmatovu/laravel-publishable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. bmatovu/laravel-publishable

ActiveLibrary[Database &amp; ORM](/categories/database)

bmatovu/laravel-publishable
===========================

Laravel publisable.

v1.1.0(5y ago)3401[3 issues](https://github.com/mtvbrianking/laravel-publishable/issues)MITPHPPHP &gt;=7.0.0CI failing

Since Jun 23Pushed 5y agoCompare

[ Source](https://github.com/mtvbrianking/laravel-publishable)[ Packagist](https://packagist.org/packages/bmatovu/laravel-publishable)[ Docs](https://github.com/mtvbrianking/laravel-publishable)[ RSS](/packages/bmatovu-laravel-publishable/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Laravel Publishable.
--------------------

[](#laravel-publishable)

[![Build Status](https://camo.githubusercontent.com/61aafd388a4ac930f6326e73f8d1bfad2ceb893edc84da87004a5f6c3e71e076/68747470733a2f2f7472617669732d63692e6f72672f6d7476627269616e6b696e672f6c61726176656c2d7075626c69736861626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mtvbrianking/laravel-publishable)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a3f3dbcc4576e5191477519810650c8e3182c1c309c3d34dbce8ee58382c6bb9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7476627269616e6b696e672f6c61726176656c2d7075626c69736861626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mtvbrianking/laravel-publishable/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/4e2190332ca855af8dad51e15dd5f8e130eaf3b487169b2f6c73986c1f77bd17/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7476627269616e6b696e672f6c61726176656c2d7075626c69736861626c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mtvbrianking/laravel-publishable/?branch=master)[![StyleCI](https://camo.githubusercontent.com/e69fe5cadd7c791f1053fe35e39dbb6139415a1bce3fdca3bdb8ca05a07a7e3f/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3237343234313935302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/274241950)[![Documentation](https://camo.githubusercontent.com/70c5babcdd071a16af5cf30083ca75172d1117c028397189392c688efcf6f25a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63756d656e746174696f6e2d426c7565)](https://mtvbrianking.github.io/laravel-publishable)

This package contains a trait to make Eloquent models publishable. It enables the model to hold a published vs non-published state, which comes in handy for things like blog posts that can be drafts or final (published) posts.

It uses a `published_at` attribute to determine the model state ie, if the model published\_at is null, the model isn't published.

### [Installation](https://packagist.org/packages/bmatovu/laravel-publishable)

[](#installation)

Install via Composer package manager:

```
composer require bmatovu/laravel-publishable

```

### Usage

[](#usage)

Add the `publsihed_at` column to your database table.

```
