This plugin is intended for those of you who are worried about your data being accidentally deleted.
You can install the package via composer:
composer require konnco/filament-safely-delete
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(),
]);
}
}
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;
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
Franky So |
Herbert Maschke |
abangijal |
Franky So |
Herbert Maschke |
Abangijal |