PHPackages                             alejandrotrevi/laravel-ankal - 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. alejandrotrevi/laravel-ankal

ActiveLibrary

alejandrotrevi/laravel-ankal
============================

Super simple statuses for your Laravel Models

v1.0.1(4y ago)3167[1 issues](https://github.com/alejandrotrevi/laravel-ankal/issues)MITPHPPHP ^7.2|^8.0

Since May 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/alejandrotrevi/laravel-ankal)[ Packagist](https://packagist.org/packages/alejandrotrevi/laravel-ankal)[ Docs](https://github.com/alejandrotrevi/laravel-ankal)[ RSS](/packages/alejandrotrevi-laravel-ankal/feed)WikiDiscussions master Synced 1mo ago

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

Super simple statuses for your Laravel Models
=============================================

[](#super-simple-statuses-for-your-laravel-models)

[![Latest Stable Version](https://camo.githubusercontent.com/4ae291b2d8058d606a760debd49afaa7bcf1641563520e673f46355fac7c02ac/68747470733a2f2f706f7365722e707567782e6f72672f616c656a616e64726f74726576692f6c61726176656c2d616e6b616c2f76)](//packagist.org/packages/alejandrotrevi/laravel-ankal) [![Total Downloads](https://camo.githubusercontent.com/7aad20267ac4028d1c5c86009b95f2a29ce35e95a6c68e3a69ab8899906e3921/68747470733a2f2f706f7365722e707567782e6f72672f616c656a616e64726f74726576692f6c61726176656c2d616e6b616c2f646f776e6c6f616473)](//packagist.org/packages/alejandrotrevi/laravel-ankal)[![GitHub Actions](https://github.com/alejandrotrevi/laravel-ankal/actions/workflows/main.yml/badge.svg)](https://github.com/alejandrotrevi/laravel-ankal/actions/workflows/main.yml/badge.svg)

Sometimes you only need a simple way to manage statuses.

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

[](#installation)

You can install the package via composer:

```
composer require alejandrotrevi/laravel-ankal
```

Optionally, you can publish the migration included with the library. The included migration is a good place to add the necessary columns to your tables or perhaps remove some columns from existing tables.

```
php artisan vendor:publish --provider="Alejandrotrevi\LaravelAnkal\LaravelAnkalServiceProvider" --tag="migrations"
```

Usage
-----

[](#usage)

Add the `HasStatuses` trait to a model.

```
use Alejandrotrevi\LaravelAnkal\HasStatuses;

class MyModel extends Model
{
    use HasStatuses;
}
```

Add the necessary migrations to each of the tables on which you will use the statuses.

```
Schema::create('my_table', function (Blueprint $table) {
    $table->statusColumns();
});
```

behind the scenes this basically adds 3 columns: `status`, `reason` and `status_updated_at`.

Optionally you can set a default status for that table, you simply pass an additional argument to the `statusColumns()`table modifier this additional argument is the default status the `status` column will have when you create a new model.

```
Schema::create('my_table', function (Blueprint $table) {
    $table->statusColumns('my_default_status');
});
```

### Set a status

[](#set-a-status)

You can set a new status like this:

```
$model->setStatus('status');
```

You can also provide a reason for the status modification.

```
$model->setStatus('status', 'why this status changed?');
```

Since the status exist on the same table you simply call the status as another property on your model.

```
$model->status;
$model->reason;
$model->status_updated_at;
```

### Scopes

[](#scopes)

You have 2 scopes available for your models `currentStatus` and `exceptStatus`.

```
// All models with status "status"
Model::currentStatus('status');

// All models with status "status" or "other-status"
Model::currentStatus('status', 'other-status');
Model::currentStatus(['status', 'other-status']);
```

Without a given status:

```
// All models except those with the "my-status" status
Model::exceptStatus('my-status');

// All models except those with the "my-status" or "other-status" statuses.
Model::exceptStatus('my-status', 'other-status');
Model::exceptStatus(['my-status', 'other-status']);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email [alex\_tf\_1992@live.com.mx](mailto:alex_tf_1992@live.com.mx) instead of using the issue tracker.

Credits
-------

[](#credits)

This package is heavily inspired in the [spatie/laravel-model-status](https://github.com/spatie/laravel-model-status) package, this aims to be a simpler version of Spatie's solution, every credit should go to them 🤗

- [Alejandro](https://github.com/alejandrotrevi)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Why Ankal?
----------

[](#why-ankal)

Ankal means "To be" in the Mayan language.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

3

Last Release

1776d ago

Major Versions

v0.9 → v1.0.02021-05-18

PHP version history (2 changes)v0.9PHP ^7.4|^8.0

v1.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a09fb84cb5a7221e7016431bdc24754aa709b454290aca23fbef401a722bbf0?d=identicon)[alejandrotrevi](/maintainers/alejandrotrevi)

---

Top Contributors

[![alejandrotrevi](https://avatars.githubusercontent.com/u/11036342?v=4)](https://github.com/alejandrotrevi "alejandrotrevi (12 commits)")

---

Tags

alejandrotrevilaravel-ankal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alejandrotrevi-laravel-ankal/health.svg)

```
[![Health](https://phpackages.com/badges/alejandrotrevi-laravel-ankal/health.svg)](https://phpackages.com/packages/alejandrotrevi-laravel-ankal)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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