Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Sanitycheck

Sanitycheck Laravel Package

chameleon-system/sanitycheck

Laravel package for running sanity checks in Chameleon System projects. Provides a structured way to define checks, execute them via CLI, and report results to help catch misconfigurations and deployment issues early in development and operations.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Sanitycheck
How do I install SanityCheck in a Laravel 10 project?
Run `composer require chameleon-system/sanitycheck` in your project root. The package requires PHP 8.0+ and Laravel 9/10. Check the `Resources/doc/Installation` folder for Laravel-specific setup steps, like binding the service provider in `config/app.php`.
Can I use this for API request validation instead of Laravel’s built-in Validator?
Yes, but it’s designed for broader system checks (e.g., config, disk space, external APIs). For API payloads, pair it with Laravel’s `FormRequest` or middleware. Example: `SanityCheck::validate($request->all(), ['rules' => [...]])` in a middleware. Avoid replacing `Validator` for complex business logic.
Does SanityCheck support custom validation rules for my Laravel models?
The package allows defining custom checks, but Laravel-specific model validation (e.g., Eloquent rules) isn’t natively supported. Extend the `Check` class or use it alongside Laravel’s `Validator` for model-level checks. Check the `Resources/doc` for rule extension examples.
Will this work in CI/CD pipelines for pre-deployment checks?
Absolutely. Run checks via CLI (e.g., `php artisan sanitycheck:run`) in your CI pipeline to validate configs, database connections, or external services before deployment. Use the `--fail-fast` flag to halt builds on critical failures.
Are there performance concerns for high-traffic Laravel apps?
SanityCheck is lightweight but avoid CPU-heavy checks (e.g., large dataset scans) in request middleware. Use it for pre-flight checks (e.g., in `bootstrap/app.php`) or async jobs (Laravel Queues) to minimize impact. Benchmark with `php artisan tinker` for critical paths.
How do I handle false positives in production?
Tune checks by adjusting thresholds (e.g., disk space warnings) or skipping non-critical checks in production via config. Use the `SanityCheck::setEnvironment()` method to exclude dev-only checks. Log results with `SanityCheck::report()` for debugging.
Does this replace Laravel Pint, PHPStan, or Psalm for static analysis?
No. SanityCheck focuses on runtime/system checks (e.g., config, APIs), while tools like PHPStan analyze code structure. Use both: SanityCheck for deployment sanity and PHPStan for static code validation. The package complements, not replaces, these tools.
Can I integrate this with Laravel’s event system for async checks?
Yes. Dispatch checks via Laravel Events (e.g., `Event::dispatch(new SystemCheckEvent())`) and listen with `SanityCheck::run()` in an event handler. Example: Trigger checks after `job:failed` events to validate recovery systems.
What Laravel versions and PHP dependencies does this support?
The package targets PHP 8.0+ and Laravel 9/10. Verify compatibility by checking the `composer.json` `require` section. If using Laravel 8.x, downgrade PHP or fork the package for legacy support.
How do I test SanityCheck in a Laravel project?
Mock checks in PHPUnit using `SanityCheck::shouldFail()` or `shouldPass()` assertions. Test CLI commands with `Artisan::call()` and validate output. For integration tests, simulate failed checks (e.g., fake disk full errors) and assert middleware/route behavior.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky