PHPackages                             neon/model-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. neon/model-publishable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

neon/model-publishable
======================

Set timestamps for content classes to handle publishing and expiring.

1.0.0(3y ago)05825MITPHPPHP &gt;=8.0.2

Since Mar 21Pushed 3y ago3 watchersCompare

[ Source](https://github.com/elementary-interactive/neon-model-publishable)[ Packagist](https://packagist.org/packages/neon/model-publishable)[ RSS](/packages/neon-model-publishable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (5)

NEON — Model Publishable
========================

[](#neon--model-publishable)

Handles any model to became publishable.

Requirements
------------

[](#requirements)

- `"neon/model-uuid": "^1.0"`

Install
-------

[](#install)

Easily install the composer package:

```
composer require neon/model-publishable
```

Usage
-----

[](#usage)

### Database

[](#database)

In the database, Publishable needs two datetime fields:

- published\_at to store from when we should show. ```
    $table->timestamp('published_at')
      ->nullable()
      ->default(null);

    ```
- expired\_at to store when the record will be expired. ```
    $table->timestamp('expired_at')
      ->nullable()
      ->default(null);

    ```

Both of them nullable with the default value NULL.

### Model

[](#model)

In the model we just should apply Publishable Trait like this:

```
use Neon\Model\Traits\Publishable;

class AwesomeModel extends Model
{
    use Publishable;
}

```

Then you can use some common method, like:

- To publish a model, there is `$model->publish()` method.
- If you have to publish in a certain time, you can use `$model->publishedAt($timestamp)` method.
- To make it expire you can use `$model->expire()` and `$model->expiredAt($timestamp)` method.

The `Published` scope automatically being applied to the model. If you would like to get all the models, you can query with `->withNotPublished()` method then the scope will not applied.

#### Events

[](#events)

This trait add some new Eloquent Model event:

- `publishing` will be called after `publish()` or `publishedAt()` method called but before save.
- After save will be `published` event fired.
- For expiring there are `expiring` and `expired` methods.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1145d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd78b9fd7d8a7c04e631a9b5448bf8f60fa8ac304f2c05225ffa1a348ebd2f4f?d=identicon)[Elementary Interactive](/maintainers/Elementary%20Interactive)

---

Top Contributors

[![elementary-b](https://avatars.githubusercontent.com/u/33206975?v=4)](https://github.com/elementary-b "elementary-b (9 commits)")[![laze](https://avatars.githubusercontent.com/u/302722?v=4)](https://github.com/laze "laze (3 commits)")

### Embed Badge

![Health badge](/badges/neon-model-publishable/health.svg)

```
[![Health](https://phpackages.com/badges/neon-model-publishable/health.svg)](https://phpackages.com/packages/neon-model-publishable)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
