thecapybaralph / laravel-uhoh
Just a package to quickly check if your app is tampered with.
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^3.0||^4.0
- pestphp/pest-plugin-laravel: ^3.0||^4.0
README
Laravel Uhoh is a tiny integrity checker for your index.php. It monitors the file and fires events if anything changes.
This is a friendly guard, not a security guard dog. If someone can modify your application, they can modify Uhoh too. Use it as a warning tool, not a defense system.
Installation
You can install the package via composer:
composer require thecapybaralph/laravel-uhoh
You can publish the config file with:
php artisan vendor:publish --tag="laravel-uhoh-config"
Usage
$tripwire = \TheCapybaRalph\LaravelUhoh\Uhoh::run(); // returns true if check passes
You can also add this to your schedule
\Illuminate\Support\Facades\Schedule::command('uhoh:check')->hourly();
Creating a Listener
The package does not include built-in notifications by default. However, it fires two events that you can listen to in your application:
\TheCapybaRalph\LaravelUhoh\Events\IntegrityCheckFailed::class; \TheCapybaRalph\LaravelUhoh\Events\IntegrityCheckPassed::class;
You can attach listeners to these events to perform any action you need when an integrity check passes or fails, such as sending notifications, logging, or triggering custom workflows.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.