konnco / filament-safely-delete
Installs: 1 786
Dependents: 0
Suggesters: 0
Security: 0
Stars: 34
Watchers: 2
Forks: 5
Open Issues: 3
Requires
- php: ^8.0
- filament/filament: ^2.0
- filament/notifications: ^2.0
- illuminate/contracts: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5|^10.0
This package is auto-updated.
Last update: 2024-12-10 01:48:14 UTC
README
Filament Confirm Delete
This plugin is intended for those of you who are worried about your data being accidentally deleted.
Installation
You can install the package via composer:
composer require konnco/filament-safely-delete
Usage
import the actions into the Resource
page
use Konnco\FilamentSafelyDelete\Tables\Actions\RevertableDeleteAction; class PostResource extends Resource { public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('title'), Tables\Columns\TextColumn::make('slug'), Tables\Columns\TextColumn::make('body'), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), DeleteAction::make() ->usingField('title') ]) ->bulkActions([ Tables\Actions\DeleteBulkAction::make(), ]); } }
Undo Delete
You can also use to delete undo in your resource.
use Konnco\FilamentSafelyDelete\Tables\Actions\RevertableDeleteAction; class PostResource extends Resource { public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('title'), Tables\Columns\TextColumn::make('slug'), Tables\Columns\TextColumn::make('body'), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), RevertableDeleteAction::make() ]) ->bulkActions([ Tables\Actions\DeleteBulkAction::make(), ]); } }
and implementing HasRevertableRecord
traits in your ListRecords
use Konnco\FilamentSafelyDelete\Pages\Concerns\HasRevertableRecord; class ListBlogPosts extends ListRecords { use HasRevertableRecord;
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.