Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running checks conditionally #139

Merged
merged 4 commits into from
Dec 14, 2022
Merged

Running checks conditionally #139

merged 4 commits into from
Dec 14, 2022

Conversation

stfndamjanovic
Copy link
Contributor

This PR is adding the possibility to run some checks only under certain conditions.

use Spatie\Health\Facades\Health;
use Spatie\Health\Checks\Checks\DebugModeCheck;
use Spatie\Health\Checks\Checks\RedisCheck;

Health::checks([
    DebugModeCheck::new()->if(app()->isProduction()),
    RedisCheck::new()->unless(app()->environment('development')),
]);

@freekmurze freekmurze merged commit a536042 into spatie:main Dec 14, 2022
@freekmurze
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants