Download the PHP package dxgx/tree-size-mailer without Composer
On this page you can find all versions of the php package dxgx/tree-size-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dxgx/tree-size-mailer
More information about dxgx/tree-size-mailer
Files in dxgx/tree-size-mailer
Package tree-size-mailer
Short Description Laravel package for generating and emailing directory tree size reports
License MIT
Informations about the package tree-size-mailer
Tree Size Mailer
A Laravel package that generates comprehensive directory tree size reports and emails them to specified recipients. Perfect for monitoring disk usage, identifying large directories, and tracking storage growth over time.
Features
- 🌳 Tree View - Hierarchical directory structure with clean indentation (shown first)
- 📊 Overview Section - High-level directory size summary
- 📂 Detailed Report - All directories with configurable row limits
- 📦 Custom Breakdowns - Break down specific directories with custom depth levels
- 🔍 Section Filters - Each section shows applied filters (size limits, exclusions)
- ⚙️ Fully Configurable - Control scan depth, size thresholds, and recipients
- 📧 Email Reports - Automatic email delivery with HTML formatting
- 🔧 Environment Support - Configure via
.envvariables
Requirements
- PHP 8.2 or higher
- Laravel 11.x or 12.x
- Configured mail driver
Installation
Install the package via Composer:
Publish Configuration
Publish the configuration file to customize settings:
This creates config/tree-size-mailer.php in your application.
Publish Views (Optional)
If you want to customize the email template:
This publishes the email blade template to resources/views/vendor/tree-size-mailer/.
Configuration
Configuration File
After publishing, edit config/tree-size-mailer.php:
Report Layout Configuration
Control which sections appear in your email reports and their order. The layout array accepts 1-3 sections from the available options:
Available Sections:
root_level_overview- First-level directories with total sizesdirectory_tree- Hierarchical tree structure with indentationdetailed_directory_sizes- Flat list sorted by size (all directory levels)custom_breakdowns- Custom sections for directories defined inbreakdown_dirs
Configuration Examples:
Email Format: The package automatically generates both HTML (styled tables) and plain text (ASCII formatted) versions of the email for maximum compatibility.
Excluding Directories
You can exclude specific directories from all report sections using wildcard patterns. Only directory paths are checked (not individual files).
Pattern Syntax:
-
/vendor*- Excludes all directories starting with/vendor
_(Matches:/vendor,/vendor_folder,/vendor/links/photos/logs)_ -
*vendor- Excludes all directories ending withvendor
_(Matches:/vendor,/super_duper_vendor, but not/my_vendor_is)_ *vendor*- Excludes all directories containingvendoranywhere
_(Matches:/vendor,/vendor_path,/my/vendor/path,/my/path/vendor)_
Configuration Example:
php 'breakdown_dirs' => [ '/vendor' => 3, // Composer packages (3 levels) '/storage/app/public/photos' => 2, // Photo storage (2 levels) '/node_modules' => 2, // NPM packages (2 levels) '/public_html' => 2, // Public assets (2 levels) ],
Performance Note: Exclusion patterns are checked in order. List more specific patterns first for optimal performance.
Effect on Reports:
- Detailed Report: Excluded directories won't appear
- Overview Section: Files in excluded directories are not counted
- Vendor Breakdown: Vendor packages matching exclusion patterns won't appear
- Tree View: Excluded directory branches are completely omitted
Environment Variables
Add these to your .env file:
Multiple Recipients
To send reports to multiple email addresses, edit the config file directly:
Usage
Manual Execution
Run the report command manually:
The command will:
- Scan the configured directory
- Generate size reports (overview, detailed, vendor breakdown, tree view)
- Email the report to all configured recipients
- Display summary statistics in the console
Scheduled Execution
Add the command to your application's scheduler for automatic reports.
Laravel 11+ (using schedule in bootstrap/app.php or routes/console.php)
Option 1: In routes/console.php:
Option 2: In bootstrap/app.php:
Laravel 10 and below (using app/Console/Kernel.php)
Scheduling Examples
Report Sections
the following sections (in order):
1. Directory Tree
Hierarchical tree view with clean 4-space indentation showing the directory structure. Only includes directories larger than min_tree_size (default: 1 MB). Shows applied depth and size filters at the bottom.
Display format: Uses fixed-width font with simple indentation (no tree characters).
2. Overview
High-level summary of directories up to the configured depth (default: 5 levels). Shows only directories larger than min_overview_size (default: 1 MB). Excludes directories configured in breakdown_dirs.
Filter note: Shows max depth, min size, and excluded breakdown directories.
3. Detailed Directory Sizes
Complete list of all directories with their sizes, sorted by size descending. Limited to detailed_max_rows (default: 100). Excludes:
- Directories smaller than
min_file_size(default: 100 KB) - Directories matching configured exclusion patterns
- Directories in
breakdown_dirs(shown in their own sections)
Filter note: Shows row limit, min size, and excluded directories.
4. Custom Direc
Detailed: 100 dirs, 3.12 GB Vendor Breakdown (3 Levels): 103 items, 123.99 MB Public Html Breakdown (2 Levels): 6 items, 5.77 MB Tree: 89 items, 2.67 GB Tree size report emailed to: [email protected]
Tree size report generated: Overview: 45 dirs, 2.34 GB Detailed: 312 dirs, 3.12 GB Vendor: 156 packages, 487.23 MB Tree: 89 items, 2.67 GB Tree size report emailed to: [email protected] bash TREE_SIZE_REPORT_SCAN_PATH=/var/www/client-sites/client-123 bash chmod -R 755 /path/to/scan bash php -d memory_limit=512M artisan dg:tree-size-mailer bash php -d max_execution_time=600 artisan dg:tree-size-mailer
## Security Considerations
- Limit scan paths to trusted directories
- Restrict email recipients to authorized personnel
- Be cautious when publishing views (may expose directory structure)
- Use queue for large scans to avoid blocking requests
## License
MIT License. See LICENSE file for details.
## Support
For issues, questions, or contributions, please contact:
- Email: [email protected]
## Used In
This package is actively used in production by the following projects:
- [DeadSimpleApps.com - well dead simple apps for smart people](https://deadsimpleapps.com)
- [tvfilmai.lt - tv filmų programa ir gidas](https://tvfilmai.lt)
- [FlyFiles.io - share files with pin](https://flyfiles.io)
- [AdvertGates.eu - car seller management and export system](https://advertgates.eu)
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for version history.All versions of tree-size-mailer with dependencies
illuminate/console Version ^9.0|^10.0|^11.0|^12.0
illuminate/mail Version ^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0