定制 satheez/laravel-deploy-guard 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

satheez/laravel-deploy-guard

Composer 安装命令:

composer require satheez/laravel-deploy-guard

包简介

A Laravel package that checks your application for deployment risks before production release.

README 文档

README

Laravel Deploy Guard

Tests Total Downloads Latest Version on Packagist License: MIT

A Laravel package that checks your application for deployment risks before production release.

laravel-deploy-guard provides a CLI-first readiness command for local checks, staging validation, and CI/CD pipelines. It inspects common Laravel deployment risks and reports clear pass, warning, fail, or skipped results.

It does not deploy your application, run migrations, change environment files, or inspect server infrastructure.

Documentation

Installation

Install the package as a development dependency:

composer require satheez/laravel-deploy-guard --dev

Publish the configuration file:

php artisan vendor:publish --tag=deploy-guard-config

Run the deployment checks:

php artisan deploy:guard

Quick Start

Run every enabled check:

php artisan deploy:guard

Run in CI mode:

php artisan deploy:guard --ci

Return JSON:

php artisan deploy:guard --json

Run selected categories or check keys:

php artisan deploy:guard --only=env,cache,migrations

Skip selected categories or check keys:

php artisan deploy:guard --except=mail,queue

Fail when warnings exist:

php artisan deploy:guard --fail-on=warning

Evaluate checks against a target environment:

php artisan deploy:guard --env=production

Example Output

Laravel Deploy Guard

Environment: production
Checks run: 22
Passed: 17
Warnings: 3
Failed: 2
Skipped: 0

FAILURES
[FAIL] env.app_debug
APP_DEBUG is enabled in a production environment.
Suggestion: Set APP_DEBUG=false before deploying to production.

WARNINGS
[WARNING] queue.connection
Queue connection is sync in production.
Suggestion: Use database, redis, sqs, or another async queue driver.

Exit Codes

Exit Code Meaning
0 No failed checks, or warnings only when warnings are allowed
1 One or more checks failed
2 One or more warnings exist and --fail-on=warning is enabled

If failures and warnings both exist, the command returns 1.

Available Checks

Category Checks
env env.app_env, env.app_key, env.app_debug, env.app_url
database database.default_connection, database.connection
migrations migrations.pending
queue queue.connection, queue.failed_jobs
cache cache.driver, cache.config, cache.routes, cache.views
storage storage.directory_writable, storage.bootstrap_cache_writable, storage.public_link
mail mail.mailer, mail.production_mailer
filesystem filesystem.default_disk, filesystem.default_disk_config, filesystem.cloud_disk
scheduler scheduler.validation

See the checks reference for behavior, status rules, and suggestions.

Configuration

The published config file is config/deploy-guard.php.

return [
    'enabled' => env('DEPLOY_GUARD_ENABLED', true),

    'production_environments' => [
        'production',
        'prod',
    ],

    'checks' => [
        'env' => true,
        'database' => true,
        'migrations' => true,
        'queue' => true,
        'cache' => true,
        'storage' => true,
        'mail' => true,
        'filesystem' => true,
        'scheduler' => true,
    ],

    'allow' => [
        'sync_queue_in_production' => false,
        'array_cache_in_production' => false,
        'log_mailer_in_production' => false,
        'array_mailer_in_production' => false,
    ],
];

See the configuration reference for all options.

JSON Output

Use --json for machine-readable reports:

php artisan deploy:guard --ci --json

See the JSON output reference for the schema and examples.

Custom Checks

Applications can register custom checks through config/deploy-guard.php:

'custom_checks' => [
    App\DeployGuard\SearchIndexReadyCheck::class,
],

See custom checks for a complete example.

Development

Install dependencies:

composer install

Run the full local quality suite:

composer test
vendor/bin/pint --test
composer rector:test
composer analyse

The package uses Pest, Pint, Rector, and Larastan. See testing and quality tools.

Security

Reports never include secret values such as application keys, database passwords, mail passwords, tokens, or private keys. See SECURITY.md.

License

The MIT License.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固