Package for monitor your storage in laravel application
hamza094/storage-monitor is a Laravel package for package for monitor your storage in laravel application.
It currently has 0 GitHub stars and 6 downloads on Packagist (latest version 1.0.2).
Install it with composer require hamza094/storage-monitor.
Discover more Laravel packages by hamza094
or browse all Laravel packages to compare alternatives.
Last updated
laravel-storage-monitor can monitor the usage of the filesystems configured in Laravel. Currently only the amount of files a local storage contains is monitored.
We invest a lot of resources into creating. You can support us.We highly appreciate you.
You can install the package via composer:
composer require hamza094/storage-monitor
You can publish and run the migrations with:
php artisan vendor:publish --provider="Hamza094\StorageMonitor\StorageMonitorServiceProvider" --tag="storage-monitor-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="Hamza094\StorageMonitor\StorageMonitorServiceProvider" --tag="storage-monitor-config"
You can publish the view file with:
php artisan vendor:publish --provider="Hamza094\StorageMonitor\StorageMonitorServiceProvider" --tag="storage-monitor-views"
This is the contents of the published config file:
return [
/**
* the names of the storage disk you want to monitor
*/
'storage_names'=> [
'local'
],
];
Finally, you should schedule the use Hamza094\StorageMonitor\Commands\StorageMonitorCommand to run daily.
// in app/Console/Kernel.php
use \Hamza094\StorageMonitor\Commands\StorageMonitorCommand;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
// ...
$schedule->command(StorageMonitorCommand::class)->daily();
}
}
You can view the amount of files each monitored disk has, in the storage_monitors table.
If you want to view the statistics in the browser add this macro to your routes file.
// in a routes files
Route::storageMonitor('storage-monitor-url');
Now, you can see all statics when browsing /storage-monitor-url. Of course, you can use any url you want when using the diskMonitor route macro. We highly recommand using the auth middleware for this route, so guests can't see any data regarding your disks.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.