PHPackages                             aecor/statusable - 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. aecor/statusable

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

aecor/statusable
================

Add status to any model

1.0.4(5y ago)0701MITPHPPHP ^7.4|^8.0

Since Nov 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/adhalwala/statusable)[ Packagist](https://packagist.org/packages/aecor/statusable)[ Docs](https://github.com/aecor/statusable)[ RSS](/packages/aecor-statusable/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

Add status to any model
=======================

[](#add-status-to-any-model)

[![Latest Version on Packagist](https://camo.githubusercontent.com/343ba51a28dab6a72cf28484b7df2a0088eabd30364f96bd8f69241e75408618/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6165636f722f73746174757361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aecor/statusable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c2c7b89db449a2031cca8d97a1f031c51efe8fc45ba5c809f14a03fe8d9bdece/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6165636f722f73746174757361626c652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/aecor/statusable/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/b3f49bda4c69126644a88446502ea0e427b762e71761cefe9fe88bc58ee8f095/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6165636f722f73746174757361626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aecor/statusable)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require aecor/statusable
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Aecor\Status\StatusServiceProvider" --tag="migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Aecor\Status\StatusServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [
    'status-table-name' => 'statuses'
];
```

Usage and few examples
----------------------

[](#usage-and-few-examples)

Prepare your model

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Aecor\Status\Traits\HasStatus;

class YourModel extends Model
{
    use HasStatus;
}
```

Get instance of your model

```
$user = \App\Models\User::find(1);
```

All the common fields are available in database given below, additionally you can store your own details as json in 'custom\_attributes' field. All the fields are kept nullable to make it easy implementation.

```
'name',
'type',
'custom_attributes' // json field to add any additional data
'order_column'
```

Add a single contact

```
$user->addStatus([
    [
        'name' => 'Active',
        'type' => 'user',
        'custom_attributes' => [
            'group' => 'some-text'
        ],
    ]
]);
```

Add multiple status

```
$user->addManyStatus([
    [
        'name' => 'Active',
    ],
    [
        'name' => 'De-active',
    ],
    [
        'name' => 'On-hold',
    ],
]);
```

Assign new status

```
$status = Status::where('name', 'Active')->first();
$status2 = Status::where('name', 'On-hold')->first();

$user->assignStatus($status->id);

$user->assignManyStatus([$status->id, $status2->id]);
```

Sync status

```
$status = Status::where('name', 'Active')->first();
$status2 = Status::where('name', 'On-hold')->first();

$user->syncStatus($status->id);

$user->syncManyStatus([$status->id, $status2->id]);
```

Get all status

```
$user->statuses;
```

Get first status

```
$user->status();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Abrar Dhalwala](https://github.com/adhalwala)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~22 days

Total

5

Last Release

1909d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.0.4PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/62330833?v=4)[Abrar Dhalwala](/maintainers/adhalwala)[@adhalwala](https://github.com/adhalwala)

---

Top Contributors

[![adhalwala](https://avatars.githubusercontent.com/u/62330833?v=4)](https://github.com/adhalwala "adhalwala (14 commits)")

---

Tags

aecorstatusable

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aecor-statusable/health.svg)

```
[![Health](https://phpackages.com/badges/aecor-statusable/health.svg)](https://phpackages.com/packages/aecor-statusable)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)

PHPackages © 2026

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