PHPackages                             signifly/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. [Database &amp; ORM](/categories/database)
4. /
5. signifly/laravel-cancellation

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

signifly/laravel-cancellation
=============================

A laravel cancellation package.

v1.5.0(5y ago)67753[1 issues](https://github.com/signifly/laravel-cancellation/issues)MITPHPPHP ^7.3|^8.0

Since Jan 28Pushed 5y ago3 watchersCompare

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

READMEChangelog (7)Dependencies (4)Versions (8)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

34

—

LowBetter than 77% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~192 days

Total

7

Last Release

1870d ago

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

v1.4.0PHP ^7.2.5

v1.5.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd06d3bd4452ca3ce5c956b4c0bcb1240ca692f590bc4cdabe104fd07156e0bf?d=identicon)[signifly](/maintainers/signifly)

---

Top Contributors

[![pactode](https://avatars.githubusercontent.com/u/5956778?v=4)](https://github.com/pactode "pactode (18 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

cancel-modelseloquentlaravellaravelcancellationsignifly

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

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

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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