fredbradley / filesystem-health-check
A Spatie Laravel Health Check, that checks your Laravel filesystems are connectable
Package info
github.com/fredbradley/filesystem-health-check
pkg:composer/fredbradley/filesystem-health-check
Requires
- php: ^8.5
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- spatie/laravel-health: ^1.37
Requires (Dev)
- laravel/pint: ^1.29
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
README
A Spatie Laravel Health Check that checks it can connect to your Laravel Filesystems
Instructions
First, ensure that Spatie Laravel Health is set up and working as expected on your instance. Documentation can be found here.
Then install this package:
composer require fredbradley/filesystem-health-check
Usage
To use this check you need to add it to your Health::checks() method. It will by default, assume that it should have full read/write access, and places a dummy file in the root of the filesystem and reads it back, then removes it. If you have a filesystem that you only read from, and don't have write access that's what the readOnly() method is for.
Examples:
use FredBradley\FilesystemHealthCheck\Checks\FilesystemHealthCheck; Health::checks([ FilesystemHealthCheck::new()->disk('sftp')->name('Check SFTP'), // checks read and write FilesystemHealthCheck::new()->disk('ext01')->readOnly()->name('Check EXT01 Read Only'), // checks read only ]);
Contribution
You're very welcome to submit PRs.