Download the PHP package bit-part/craft-asset-trash without Composer

On this page you can find all versions of the php package bit-part/craft-asset-trash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-asset-trash

Asset Trash for Craft CMS 5

English | Deutsch

A Craft CMS 5 plugin that provides a trash/recycle bin for deleted assets. When an asset is deleted, the file is copied to a .trash/ directory within the volume, and a database record is kept so it can be restored or permanently deleted later from the control panel.

Requirements

Installation

Via Composer (recommended)

Then install the plugin from the Craft control panel under Settings > Plugins, or via the CLI:

Manual Installation

  1. Download the release from GitHub
  2. Place the contents in a directory and add a path repository to your project's composer.json
  3. Run composer require bit-part/craft-asset-trash
  4. Install via the control panel or CLI

How It Works

When you delete an asset in Craft:

  1. The plugin intercepts the deletion event
  2. The file is copied to a .trash/ directory inside the same volume (e.g., uploads/.trash/)
  3. A database record is created with metadata (filename, size, volume, path, who deleted it, and element references at the time of deletion)
  4. Craft's normal deletion proceeds (the original asset element is removed)

The trashed file remains in .trash/ until you restore or permanently delete it.

Features

Trash Listing

A dedicated Asset Trash section appears in the control panel's primary navigation. The listing shows:

Volume Filtering

If you have multiple volumes, a dropdown filter lets you view trash items from a specific volume or all volumes at once.

Detail View

Click a filename to see full metadata:

Restore

Restore a trashed item to its original volume and folder. The plugin creates a new asset element and moves the file back from .trash/ to the original location. If a file with the same name already exists, a unique suffix is added automatically.

Permanent Delete

Remove a trashed item permanently. This deletes the file from .trash/ and removes the database record. This action cannot be undone.

Bulk Actions

Select multiple items using the checkboxes, then use Restore Selected or Delete Selected to act on them all at once.

Empty Trash

The Empty Trash button permanently deletes all items in the trash (or all items in the currently filtered volume). A confirmation dialog is shown before proceeding.

Auto-Purge

Expired items can be automatically purged during Craft's garbage collection. Configure the retention period and enable/disable auto-purge in the plugin settings.

Settings

Navigate to Settings > Plugins > Asset Trash to configure:

Setting Default Description
Retention Days 30 Number of days to keep trashed items before auto-purge. Set to 0 to keep items indefinitely.
Auto Purge On When enabled, expired items are automatically deleted during Craft's garbage collection.
Trash Directory Name .trash The directory name within each volume where trashed files are stored. Must contain only letters, numbers, dots, hyphens, and underscores.

Permissions

The plugin registers four permissions under Asset Trash:

Permission Description
View trash Access the Asset Trash section in the control panel
Restore assets Restore trashed items back to their original location
Permanently delete assets Permanently delete individual trashed items
Empty trash Use the "Empty Trash" button to delete all items at once

Permissions are nested: the three action permissions require the "View trash" permission to be granted first.

Translations

The plugin includes translations for:

Support

License

This plugin is licensed under the MIT License.


Built by bit part LLC


All versions of craft-asset-trash with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bit-part/craft-asset-trash contains the following files

Loading the files please wait ...