PHPackages                             pristavu/laravel-cancellation - 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. pristavu/laravel-cancellation

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

pristavu/laravel-cancellation
=============================

A laravel cancellation package

v4.0.0(1mo ago)1132MITPHPPHP ^8.2CI failing

Since Jan 28Pushed 1mo agoCompare

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

READMEChangelog (2)Dependencies (8)Versions (11)Used By (0)

Cancel models inside your Laravel app
=====================================

[](#cancel-models-inside-your-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3df0fc2ddf5a925d15c40fc0e0f01905a3db509eef5e99c0c0c5d937ec4abcfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7369676e69666c792f6c61726176656c2d63616e63656c6c6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/signifly/laravel-cancellation)[![Tests](https://github.com/signifly/laravel-janitor/workflows/Tests/badge.svg)](https://github.com/signifly/laravel-janitor/workflows/Tests/badge.svg)[![StyleCI](https://camo.githubusercontent.com/2d263f1182fcea150c48441f293d3808c88d221d44594836165c85b908409424/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131393231353431332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/119215413)[![Quality Score](https://camo.githubusercontent.com/b5e836c1d87adc4ee09ed6bdb72fab651d6405a65ca6dacc46d4b4dbd98c5e67/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7369676e69666c792f6c61726176656c2d63616e63656c6c6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/signifly/laravel-cancellation)[![Total Downloads](https://camo.githubusercontent.com/61f43dc1512e1426801138b22437ba7f6ea94263402ef433f5c493fdda84fee1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7369676e69666c792f6c61726176656c2d63616e63656c6c6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/signifly/laravel-cancellation)

The `signifly/laravel-cancellation` package allows you to easily handle cancellation of your models. It is inspired by the SoftDeletes implementation in Laravel.

All you have to do to get started is:

```
// 1. Add cancelled_at column to your table by using our macro cancellable
Schema::create('orders', function (Blueprint $table) {
    // ...
    $table->cancellable();
    // ...
});

// 2. Add the Cancellable trait to your model
class Order extends Model
{
    use Cancellable;
}
```

Here's a little demo of how you can use it after adding the trait:

```
$order = Order::find(1);
$order->cancel();
```

You can query cancelled entities:

```
$orders = Order::onlyCancelled()->get(); // returns all the cancelled entities
$orders = Order::withCancelled()->get(); // includes cancelled entities
$orders = Order::withoutCancelled()->get(); // excludes cancelled entities
```

Other useful methods:

```
$order->isCancelled(); // returns true or false
$order->keep(); // keep a cancelled order

Order::whereKey([1, 2, 3])->keep(); // keeps orders with ids: 1, 2, 3
```

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

[](#installation)

You can install the package via composer:

```
$ composer require signifly/laravel-cancellation
```

The package will automatically register itself.

You can publish the config with:

```
$ php artisan vendor:publish --provider="Signifly\Cancellation\CancellationServiceProvider" --tag="config"
```

*Note*: If you set the exclude variable to true in your config, your query results will not include cancelled results by default (just like SoftDeletes).

This is the contents of the published config file:

```
return [
    /**
     * Exclude the cancellations from the model's queries.
     * Will apply to all, find, etc.
     */
    'exclude' => false,
];
```

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Morten Poul Jensen](https://github.com/pactode)
- [All contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 64.3% 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 ~331 days

Recently: every ~505 days

Total

10

Last Release

46d ago

Major Versions

v1.5.0 → v2.0.02022-04-01

v2.0.0 → v3.0.02024-11-12

v3.0.0 → v4.0.02026-03-28

PHP version history (4 changes)v1.0.0PHP ^7.0

v1.4.0PHP ^7.2.5

v1.5.0PHP ^7.3|^8.0

v4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2875b9ef72b09212f72a878c4eb30c237ad1adf460ddd1a1f376ef7d4090f83e?d=identicon)[pristavu](/maintainers/pristavu)

---

Top Contributors

[![pactode](https://avatars.githubusercontent.com/u/5956778?v=4)](https://github.com/pactode "pactode (18 commits)")[![pristavu](https://avatars.githubusercontent.com/u/4123729?v=4)](https://github.com/pristavu "pristavu (8 commits)")[![connors511](https://avatars.githubusercontent.com/u/527889?v=4)](https://github.com/connors511 "connors511 (1 commits)")[![ikidnapmyself](https://avatars.githubusercontent.com/u/13779866?v=4)](https://github.com/ikidnapmyself "ikidnapmyself (1 commits)")

---

Tags

laravelcancellationsignifly

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pristavu-laravel-cancellation/health.svg)

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

###  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)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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