neoniche / laravel-app-monitor
A simple way to monitor laravel application disk usage and other resources.
Requires
- php: ^8.1
- illuminate/contracts: ^9.0
- illuminate/database: ^9.0
- illuminate/http: ^9.0
- illuminate/support: ^9.0
- illuminate/view: ^9.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-09 14:21:43 UTC
README
This package will help monitor a laravel application disk metrics.
Installation
You can install the package via composer:
composer require neoniche/laravel-app-monitor
You can publish and run the migrations with:
php artisan vendor:publish --tag="app-monitor-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="app-monitor-config"
This is the contents of the published config file:
return [ /** * The name of the disk you want to monitor. * default: 'local' */ 'disk_names' => [ 'local', ], ];
You should set up a schedule to run the command app-monitor:log
to record the disk metrics.
// app/Console/Kernel.php use Neoniche\AppMonitor\Commands\AppMonitorCommand; class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule) { $schedule->command(AppMonitorCommand::class)->daily(); } }
Optionally, you can publish the views using
php artisan vendor:publish --tag="app-monitor-views"
Usage
If you wish to view the statistics that is logged to the database in a browser. You should add the macro below to your routes file. ```php // in a routes files Route::appMonitor('custom-monitor-url'); Now, you can see all statics when browsing /custom-monitor-url/disk-file-logs. You can change the custom-monitor-url to whatever suits you. We highly recommand using the auth middleware for this route, so guests can't see any data regarding your disks.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.