Revive is a plugin for FilamentPHP that brings a central Recycle Bin to your application. It lets you restore or permanently delete soft-deleted Eloquent models in just a few clicks.
This plugin is especially useful for SaaS applications, admin dashboards, or any multi-user platform where recovering accidentally deleted data is important.
Filament v4 is currently in beta, and this plugin does not support it yet.
We will begin testing and adapting the package soon. Until then, please use this plugin with Filament v3.x only.
Trying to install this plugin on Filament v4 may result in unexpected errors or breaking changes.
Stay tuned for updates when full support becomes available.
Install the package via Composer:
composer require promethys/revivephp artisan revive:install
If you prefer to manually publish and run the migrations:
php artisan vendor:publish --tag="revive-migrations"php artisan migrate
Register the plugin in your panel:
use Promethys\Revive\RevivePlugin; $panel->plugins([ RevivePlugin::make()]);
You can also customize the plugin using fluent configuration:
use Promethys\Revive\RevivePlugin; $panel->plugins([ RevivePlugin::make() ->authorize(auth()->user()->isAdmin()) // Accepts a boolean or Closure to control access ->navigationGroup('Settings') // Group the page under a custom sidebar section ->navigationIcon('heroicon-o-archive-box-arrow-down') ->activeNavigationIcon('heroicon-o-archive-box-arrow-down') ->navigationSort(1) ->navigationLabel('Custom Label') ->title('Custom Title') ->slug('custom-slug')]);
⚠️ The plugin currently supports only models in the
App\Models
namespace. If you want to register a third-party model (e.g., from another package), create a wrapper class that extends it and add theRecyclable
trait there:
namespace App\Models; use Promethys\Revive\Traits\Recyclable;use Vendor\Package\Models\Foo as BaseFoo; class Foo extends BaseFoo{ use SoftDeletes; use Recyclable;}
Once the plugin is installed and configured, you'll see a new page in your Filament navigation menu.
From there, users can restore deleted data or permanently remove it.
In v1, Revive will show all the Recyclable records in a single table, without any user-specific scope. You may use the plugin in your admin panel for now. User-specific scope will be available in v2.
Recyclable
trait to any soft-deletable modeluse Promethys\Revive\Concerns\Recyclable; class Post extends Model{ use SoftDeletes; use Recyclable;}
ℹ️ Important: Adding the
Recyclable
trait without usingSoftDeletes
will throw an exception.
If you already have soft-deleted records before installing the plugin, you can "discover" them by running:
php artisan revive:discover-soft-deleted
This command will:
Recyclable
traitPreview changes without making them:
php artisan revive:discover-soft-deleted --dry-run
Use this to see how many records would be discovered without actually adding them to the recycle bin.
Discover records for a specific model:
php artisan revive:discover-soft-deleted --model=Product# or use the full class namephp artisan revive:discover-soft-deleted --model="App\Models\Shop\Product"
Combine options:
php artisan revive:discover-soft-deleted --model=Category --dry-run
$ php artisan revive:discover-soft-deleted Discovering soft-deleted records... 🔍 Scanning Category... No soft-deleted records found.🔍 Scanning Comment... ✅ 0/3 records discovered🔍 Scanning Brand... ✅ 8/8 records discovered🔍 Scanning Category... ✅ 2/2 records discovered🔍 Scanning Customer... ✅ 0/1 records discovered🔍 Scanning Order... No soft-deleted records found.🔍 Scanning Product... ✅ 12/15 records discovered ✨ Discovery completed: • 29 total soft-deleted records scanned • 22 new records discovered and added to recycle bin
💡 Tips:
- Run the command with
--dry-run
first to preview what will be discovered, especially on production systems with large amounts of existing data.- For large systems with extensive output, consider redirecting the command output to a file:
php artisan revive:discover-soft-deleted > discovery-results.txt
You don't have to register the plugin in your panel to use the table.
Instead, you can render the Livewire component directly in a Blade view:
@livewire(\Promethys\Revive\Tables\RecycleBin::class)
This is ideal if:
If you encounter a bug or unexpected behavior, please help us help you by following these guidelines:
The more details you provide, the faster and better we can help. Thank you!
See CONTRIBUTING for guidelines.
This project is open-sourced under the MIT license.
See LICENSE.md for more details.
Promethys is an independent web agency in development, exploring modern, high-performance, and tailor-made digital solutions.
We're currently building the foundation of our tools, methods, and open-source contributions — with a strong focus on clean design, robust development, and API integration.