donald1597/disk-usage
最新稳定版本:1.2.1
Composer 安装命令:
composer require donald1597/disk-usage
包简介
A package to display and manage disk usage.
README 文档
README
Disk Usage Package is a Laravel package designed to monitor and manage disk usage within your Laravel application. It provides an intuitive interface to view and manage disk usage statistics, making it easier to keep track of your project's storage.
Features
- View the total size of the Laravel project directory.
- Monitor server disk space including total, free, and used space.
- Visualize disk usage with interactive charts.
- Detailed view of directory contents including file size and type.
- Option to delete files and directories directly from the interface.
Installation
-
Add the Package to Your Project
You can install the package via Composer. Run the following command in your Laravel project directory:
composer require donald1597/disk-usage
-
Add the Service Provider to your
config/app.php:Open your
config/app.phpfile and add the following line to theprovidersarray:Donald1597\DiskUsage\Http\DiskUsageServiceProvider::class,
-
Publishing the Configuration
php artisan vendor:publish --provider="Donald1597\DiskUsage\Http\DiskUsageServiceProvider" --tag=config
- Make sure to set these variables in your .env file: for example
DISK_USAGE_THRESHOLD_PERCENTAGE=1 DISK_USAGE_THRESHOLD_ABSOLUTE=1048576 DISK_USAGE_NOTIFICATION_EMAIL=user@example.com
- Set Up Queues for Notifications
Notification
When disk usage exceeds the defined thresholds, an email notification will be sent to the address specified in DISK_USAGE_NOTIFICATION_EMAIL.
To handle email notifications asynchronously, you need to configure Laravel queues. Follow these steps:
Configure the Queue Driver
In your .env file, set up the queue driver:
QUEUE_CONNECTION=database
You can also choose other queue drivers like redis or sqs depending on your setup.
Create a Queue Table
If you are using the database queue driver, create the necessary tables by running:
php artisan queue:table php artisan migrate
- Run the Queue Worker
Start the queue worker to process the queued jobs:
php artisan queue:work
Usage
After installation, you can access the disk usage dashboard via the route: disk-usage
Uninstallation
To uninstall the package:
-
Remove the package via Composer:
composer remove donald1597/disk-usage
-
Remove the Service Provider from
config/app.php:Open your
config/app.phpfile and remove the following line from theprovidersarray:Donald1597\DiskUsage\Http\DiskUsageServiceProvider::class,
-
Clean up any published assets or configurations if necessary.
Contributing
Feel free to contribute to this package by opening issues or submitting pull requests.
License
This package is licensed under the MIT License.
donald1597/disk-usage 适用场景与选型建议
donald1597/disk-usage 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 3, 最近一次更新时间为 2024 年 07 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 donald1597/disk-usage 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 donald1597/disk-usage 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-23