PHPackages                             alish/activeable-model - 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. alish/activeable-model

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

alish/activeable-model
======================

activate or deactivate any model any time on demand.

v0.1.0(5y ago)08MITPHPPHP ^7.4

Since Dec 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bdp-raymon/activeable-model)[ Packagist](https://packagist.org/packages/alish/activeable-model)[ Docs](https://github.com/alish/activeable-model)[ RSS](/packages/alish-activeable-model/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

A laravel package to activate or deactivate models on demand
============================================================

[](#a-laravel-package-to-activate-or-deactivate-models-on-demand)

[![Latest Version on Packagist](https://camo.githubusercontent.com/893ec6743e293da8f83c3250e9171413e5704dd8e14f795564de0ca00aca1032/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6973682f61637469766561626c652d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alish/activeable-model)[![Build Status](https://camo.githubusercontent.com/08c767a45344ec79e54b125731c2fa662d8348a07727eb5fdc85a9bc087734d6/68747470733a2f2f7472617669732d63692e6f72672f6264702d7261796d6f6e2f61637469766561626c652d6d6f64656c2e7376673f6272616e63683d6d61696e)](https://travis-ci.org/bdp-raymon/activeable-model)[![Quality Score](https://camo.githubusercontent.com/6000468d4928dbe9a7be2c09a9fb37b21dfaf0fc71ad7dceddf9e5ad93087b52/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6264702d7261796d6f6e2f61637469766561626c652d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bdp-raymon/activeable-model)[![Total Downloads](https://camo.githubusercontent.com/9345e92241d02671abfc610abaa2dfa8574b93b651b1303c84127caa58f78419/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c6973682f61637469766561626c652d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alish/activeable-model)

with this package you can add activation ability to your models

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

[](#installation)

You can install the package via composer:

```
composer require alish/activeable-model
```

Usage
-----

[](#usage)

for adding activation behavior to your model just use `IsActiveable` trait to your model

```
use Alish\ActiveableModel\Tratis\IsActiveable;

class Model {
    use IsActiveable;
}
```

the default behavior of activation has been set to `true` ,if you want that your models became deactive by default:

```
class Model {
    use IsActiveable;

    protected bool $defaultStatus = false;
}
```

you have access to history of activation of your model with

```
    $histories = $model->activeStates()->get();

    // get the exact time of state change
    /** @var \Carbon\Carbon $changeStateTime */
    $changeStateTime = $histories->first()->created_at;

    // you can also get the status of state change
    /** @var bool $status */
    $status = $histories->first()->is_active;
```

you can also publish the migration file:

```
php artisan vendor:publish --provider="Alish\ActiveableModel\ActiveableModelServiceProvider" --tag=migrations
```

### 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  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ali Shabani](https://github.com/alish)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

2016d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/216bcba65e7ebc9c9669dc6629806763ccfbe39b5b40d898e710dbacfcba6faa?d=identicon)[pyramidalish](/maintainers/pyramidalish)

---

Top Contributors

[![ali-shabani](https://avatars.githubusercontent.com/u/12711392?v=4)](https://github.com/ali-shabani "ali-shabani (7 commits)")

---

Tags

alishactiveable-model

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alish-activeable-model/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[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)
