Skip to content

Trash Bin & Soft Deletes ​

When soft_deletes is enabled (the default), deleting files or folders marks their database records as deleted and keeps file contents on disk for restoration. The Trash sidebar entry is hidden when soft deletes are disabled.

Key Capabilities

  • Dedicated Bin View: Access the Trash Bin directly from the sidebar. The root shows deleted folders and independently deleted files on the current disk; open a deleted folder to inspect its contents.
  • One-Click Restore: Restore individual items from the context dropdown or select multiple items and click Restore Selected.
  • Permanent Deletion: Delete individual or selected trashed items to remove stored file contents and database records. Deleting a folder also removes its nested files, following the original folder hierarchy rather than matching every record with the same storage path.
  • Empty Trash: Purge all trashed files and folders across the selected disk with a single click.
php
// config/filament-sanchaya.php
'soft_deletes' => true, // Set to false to immediately force-delete files from disk

Permanent deletion cannot be undone. With soft_deletes set to false, the ordinary Delete action is permanent.

Since v1.1.1, you can delete a folder, create another folder with the same name, and then permanently delete the old folder from Trash without deleting the new folder's files. If a stored file path has been reused, Sanchaya keeps the bytes while another file record still references that path.

From v1.1.2, deleted folder contents no longer appear as separate root-level items. Open a deleted folder to inspect its files and subfolders, and use the breadcrumbs to return to the Trash root. Search checks all trashed items, including files nested inside deleted folders. The Trash badge counts all deleted records, while the root list shows only top-level entries.

Restore a deleted folder to recover its contents. A child cannot be restored on its own while its parent folder remains deleted; Sanchaya asks you to restore the parent first. Permanently deleting a folder removes its descendants. Empty Trash still purges every deleted item on the selected disk.

Released under the MIT License.