Looking to hire Laravel developers? Try LaraJobs

laravel-checks maintained by concept-image

Description
Laravel Checks: Spatie Laravel Health with extra checks (public/index.php, unexpected files, exposed files, SMTP), a publishable health configuration and a publishable service provider registering the production health checks.
Last update
2026/11/13 17:04 (dev-main)
License
Links
Downloads
14

Comments
comments powered by Disqus

Laravel Checks

Latest Version on Packagist License

Extra Spatie Laravel Health checks for production Laravel applications, and an install command that publishes a ChecksServiceProvider registering the usual production checks. Each project then adds, removes or tweaks its checks in PHP.

Requirements

  • PHP 8.3 or higher
  • Laravel 12 or 13
  • spatie/laravel-health configured in the application (result stores, notifications, route)

Installation

composer require concept-image/laravel-checks
php artisan laravel-checks:install

The install command publishes app/Providers/ChecksServiceProvider.php and adds it to bootstrap/providers.php. To publish the provider only, without registering it:

php artisan vendor:publish --tag=laravel-checks-provider

The package itself registers no check: the published provider owns the list.

Published provider

final class ChecksServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        Health::checks([
            DebugModeCheck::new(),
            EnvironmentCheck::new()->expectEnvironment('production'),
            // \Spatie\Health\Checks\Checks\HorizonCheck::new(),
            // \Spatie\Health\Checks\Checks\RedisCheck::new(),
            SecurityAdvisoriesCheck::new(),
            IndexCheck::new(),
            PublicCheck::new(),
            SmtpCheck::new(),
        ]);
    }
}

Uncomment Horizon (requires laravel/horizon) and Redis when the project uses them, and use the fluent options of each check, for example SmtpCheck::new()->mailer('ses-smtp').

Checks shipped by the package

Check Fails when
IndexCheck public/index.php differs from the Laravel skeleton file of the installed major version (warning when it cannot be fetched)
PublicCheck public/ contains a file or a root directory outside the allowed lists
SmtpCheck the mailer (the default one, or ->mailer()) is not an SMTP mailer, or cannot connect and authenticate to its server

SmtpCheck opens an SMTP session (connection, EHLO, TLS, authentication) and closes it: no email is sent.

Testing

composer ci

Changelog

See CHANGELOG.

License

The MIT License (MIT). See License File.