PHP code example of abdulkadiragoliya / asset-guardian

1. Go to this page and download the library: Download abdulkadiragoliya/asset-guardian library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

abdulkadiragoliya / asset-guardian example snippets




return [
    // Threshold in MB for flagging large files (default: 10)
    'largeFileThresholdMb' => 10,

    // Days before an unreferenced asset is considered low risk (default: 180)
    'unusedGracePeriodDays' => 180,

    // File kinds to inspect (image, pdf, document, video, etc.)
    'monitoredFileKinds' => ['image', 'pdf', 'document', 'video', 'compressed'],

    // Volume handles to exclude from automated audits
    'excludedVolumes' => [],

    // Enable soft-delete to Craft Trash (recommended: true)
    'softDeleteDefault' => true,

    // Notification email for automated scan reports
    'notificationEmail' => '',
];
bash
php craft plugin/install asset-guardian