PHPackages                             open-southeners/laravel-model-status - 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. open-southeners/laravel-model-status

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

open-southeners/laravel-model-status
====================================

A very simple yet very integrated Laravel status package

3.0.0(1y ago)0274MITPHPPHP ^8.2CI failing

Since Dec 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/open-southeners/laravel-model-status)[ Packagist](https://packagist.org/packages/open-southeners/laravel-model-status)[ RSS](/packages/open-southeners-laravel-model-status/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (13)Used By (0)

Laravel Model Status [![required php version](https://camo.githubusercontent.com/e1138515c6261e4f84fa795059eefa507096984cbd0ebe5bab103148ec6651f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f70656e2d736f757468656e6572732f6c61726176656c2d6d6f64656c2d737461747573)](https://www.php.net/supported-versions.php) [![codecov](https://camo.githubusercontent.com/53595863250ba73700de9a6bebb8bc535e53cb8219c0f0d74f25255569862930/68747470733a2f2f636f6465636f762e696f2f67682f6f70656e2d736f757468656e6572732f6c61726176656c2d6d6f64656c2d7374617475732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d33395652414457414444)](https://codecov.io/gh/open-southeners/laravel-model-status) [![Edit on VSCode online](https://camo.githubusercontent.com/1e825ede949540f53ec4dce8dc8ad93376081856a01b7e3ce2f24f41c9133405/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7673636f64652d656469742532306f6e6c696e652d626c75653f6c6f676f3d76697375616c73747564696f636f6465)](https://vscode.dev/github/open-southeners/laravel-model-status)
============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#laravel-model-status---)

A very simple yet very integrated Laravel status package (now using native enums, no database required)

Getting started
---------------

[](#getting-started)

```
composer require open-southeners/laravel-model-status

```

### Create status enum

[](#create-status-enum)

Imaging you've a `Post` model, you should then create an enum like `PostStatus` that might look like this one:

```
use OpenSoutheners\LaravelModelStatus\ModelStatus;

enum PostStatus: int implements ModelStatus
{
    case Draft = 1;

    case Published = 2;

    case Hidden = 3;
}
```

Now remember to import `ModelStatus` interface and use it in the enum.

### Setup your model

[](#setup-your-model)

Adding 3 things: The `ModelStatuses` PHP attribute, implementing `Statusable` interface to your class and using `HasStatuses` trait.

```
use OpenSoutheners\LaravelModelStatus\Attributes\ModelStatuses;
use OpenSoutheners\LaravelModelStatus\HasStatuses;
use OpenSoutheners\LaravelModelStatus\Statusable;

// Remember to replace PostStatus::class with whatever the enum you are using
// Also second option is a boolean that enable/disable events
#[ModelStatuses(PostStatus::class, true)]
class Post extends Model implements Statusable
{
    use HasStatuses;
}
```

### Available methods

[](#available-methods)

#### setStatus

[](#setstatus)

```
$post = new Post();

// Set status to post instance
$post->setStatus(PostStatus::Published);

// Set status to post instance and persist to DB
$post->setStatus(PostStatus::Published, true);
```

#### setStatusWhen

[](#setstatuswhen)

```
// Set status to post instance only when current status is "Draft"
$post->setStatusWhen(PostStatus::Draft, PostStatus::Published);

// Set status to post instance and persist to DB only when current status is "Draft"
$post->setStatusWhen(PostStatus::Draft, PostStatus::Published, true);
```

#### hasStatus

[](#hasstatus)

```
// Check current status is "Published"
$post->hasStatus(PostStatus::Published);

// Check current status is "Published" as string (type sensitive)
$post->hasStatus('Published');
```

#### withoutStatusEvents

[](#withoutstatusevents)

```
// Whenever you save the model updates and don't want to trigger events
Post::withoutStatusEvents(fn () => $post->setStatus(PostStatus::Published));
```

### Model events

[](#model-events)

Right now this package offers a `OpenSoutheners\LaravelModelStatus\Events\StatusSwapped` event that you can use to get changes performed with `setStatusWhen` method.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance45

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~73 days

Recently: every ~189 days

Total

12

Last Release

428d ago

Major Versions

1.2.1 → 2.0.02023-02-02

2.1.0 → 3.0.02025-03-11

PHP version history (3 changes)1.0.0PHP ^8.1|^8.2

2.1.0PHP ^8.1

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a77db503aca4f77ebd99d5083432b8d9eee1131c2a572bb890aabd6b993f9d1?d=identicon)[d8vjork](/maintainers/d8vjork)

---

Top Contributors

[![d8vjork](https://avatars.githubusercontent.com/u/2331052?v=4)](https://github.com/d8vjork "d8vjork (47 commits)")

---

Tags

eloquent-modelslaravel-packagemodel-statusphp-attributesphp-enumphp8laravellaravel-packagephp8open-southenersphp-attributesphp-enumsmodel-statuses

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-southeners-laravel-model-status/health.svg)

```
[![Health](https://phpackages.com/badges/open-southeners-laravel-model-status/health.svg)](https://phpackages.com/packages/open-southeners-laravel-model-status)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

151423.7k6](/packages/imanghafoori-laravel-nullable)[matt-daneshvar/laravel-survey

Create surveys inside your Laravel app

28770.3k](/packages/matt-daneshvar-laravel-survey)[paxha/laravel-reportable

This Laravel Eloquent extension provides record according to dates using models.

111.2k](/packages/paxha-laravel-reportable)

PHPackages © 2026

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