PHPackages                             tkachikov/laravel-withtrashed - 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. tkachikov/laravel-withtrashed

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

tkachikov/laravel-withtrashed
=============================

Trait for set magic method withTrashed for models with SoftDelete

1.0.2(2y ago)24.1k↓40.9%2MITPHPPHP ^8.1

Since May 31Pushed 2y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (2)

Laravel WithTrashed
-------------------

[](#laravel-withtrashed)

[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)

Trait for set magic method withTrashed for models with SoftDelete

### Usage

[](#usage)

```
use Tkachikov\LaravelWithtrashed\WithTrsashed;

class User {
    use WithTrashed;

    public function posts()
    {
        return $this->hasMany(Post::class);
    }
}

$posts            = $user->posts;            // default
$postsWithTrashed = $user->postsWithTrashed; // using trait

$postsBuilder            = $user->posts();            //default
$postsBuilderWithTrashed = $user->postsWithTrashed(); // using trait

$userPosts            = User::with('posts')->first();            // default
$userPostsWithTrashed = User::with('postsWithTrashed')->first(); // using trait
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

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

Total

3

Last Release

1077d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laraveltraitsoftdeletewithTrashed

### Embed Badge

![Health badge](/badges/tkachikov-laravel-withtrashed/health.svg)

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

###  Alternatives

[cybercog/laravel-love

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

1.2k302.7k1](/packages/cybercog-laravel-love)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[cybercog/laravel-nova-ban

A Laravel Nova banning functionality for your application.

40199.8k](/packages/cybercog-laravel-nova-ban)[pawelmysior/laravel-publishable

Toggle the published state of your Eloquent models easily

2219.1k3](/packages/pawelmysior-laravel-publishable)

PHPackages © 2026

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