PHPackages                             haybea/laravel-trashcan - 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. [Admin Panels](/categories/admin)
4. /
5. haybea/laravel-trashcan

ActiveLibrary[Admin Panels](/categories/admin)

haybea/laravel-trashcan
=======================

An observability &amp; recovery console for Laravel soft-deleted records

v1.2.5(4mo ago)142MITBladePHP ^8.1

Since Jan 6Pushed 4mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (10)Used By (0)

Laravel Trashcan
================

[](#laravel-trashcan)

An observability &amp; recovery console for Laravel soft-deleted records.

Laravel Trashcan provides a beautiful dashboard/console to manage your soft-deleted Eloquent records. Instead of digging through database tables or writing manual "Restore" logic, Trashcan gives you a central hub to visualize, restore, or permanently purge "trashed" data.

Features
--------

[](#features)

- **Centralized Dashboard**: View all models using the `SoftDeletes` trait in one place
- **Relationship Awareness**: See which child records will be affected before you restore or purge a parent
- **Safe by Default**: Automatically restricted to local environments, with a simple Gate for production access
- **Search &amp; Filter**: Filter by model type, deletion date, or search for specific IDs/attributes
- **Bulk Operations**: Restore or permanently delete multiple items at once
- **Activity Logging**: Track all restore and delete operations
- **Export Functionality**: Export trashed records to CSV or JSON

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

[](#installation)

You can install the package via Composer. After the package is installed, publish its assets and configuration file.

```
composer require haybea/laravel-trashcan

php artisan trashcan:install
```

Usage
-----

[](#usage)

Visit `/trashcan` in your browser to access the dashboard.

### Registering Models

[](#registering-models)

By default, Trashcan will attempt to find all models in your `app/Models` directory that use the `SoftDeletes` trait. If you have models in custom locations, you can define them in the `config/trashcan.php` file:

```
'only' => [
    App\Models\User::class,
    App\Models\Post::class,
    // Add your custom models here
],
```

Alternatively, you can exclude specific models:

```
'exclude' => [
    App\Models\SensitiveModel::class,
],
```

Configuration
-------------

[](#configuration)

Edit `config/trashcan.php` to customize Trashcan's behavior:

- **Middleware**: Add custom middleware for authentication/authorization
- **Models**: Configure which models to include/exclude
- **Columns**: Customize which columns to display per model
- **Searchable**: Define searchable columns per model
- **Logging**: Enable/disable activity logging
- **Export**: Configure export functionality

Authorization
-------------

[](#authorization)

By default, Trashcan only allows access in the `local` environment. To grant access in production, you should modify the gate method within your `AppServiceProvider` or create a custom service provider:

```
use Illuminate\Support\Facades\Gate;

/**
 * Register the Trashcan gate.
 *
 * This gate determines who can access Trashcan in non-local environments.
 */
protected function gate(): void
{
    Gate::define('viewTrashcan', function ($user) {
        return in_array($user->email, [
            'admin@yourdomain.com',
        ]);
    });
}
```

You can also configure per-model permissions in `config/trashcan.php`:

```
'model_permissions' => [
    App\Models\User::class => [
        'view' => 'viewTrashedUsers',
        'restore' => 'restoreUsers',
        'delete' => 'forceDeleteUsers',
    ],
],
```

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance78

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

9

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24a4d1af58b6a6b284a396adb76d8bd555471c104124c866a5cd92e24c53eb53?d=identicon)[haybea](/maintainers/haybea)

---

Top Contributors

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

---

Tags

laraveldashboardadmintrashsoft deletestrashcan

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/haybea-laravel-trashcan/health.svg)

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

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[awes-io/indigo-layout

Basic styles and components set for building user interfaces.

4424.6k4](/packages/awes-io-indigo-layout)

PHPackages © 2026

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