-
-
Notifications
You must be signed in to change notification settings - Fork 0
Output Formats
Laravel Safeguard supports multiple output formats to meet different needs, from human-readable CLI output to machine-parseable formats for automation and integration.
Human-readable format with colors and icons, perfect for terminal usage.
php artisan safeguard:check
# or explicitly
php artisan safeguard:check --format=cli
Example Output:
π Laravel Safeguard Security Check
βββββββββββββββββββββββββββββββββββββββ
Environment: production
β
APP_KEY is set
β
CSRF protection enabled
β APP_DEBUG is enabled in production
β οΈ Database connection not encrypted
βββββββββββββββββββββββββββββββββββββββ
π― 2 issues found, 2 checks passed
Machine-readable format ideal for automation, CI/CD, and integrations.
php artisan safeguard:check --format=json
Example Output:
{
"status": "failed",
"environment": "production",
"timestamp": "2025-01-01T10:00:00Z",
"checks": [
{
"rule": "app-key-is-set",
"status": "passed",
"severity": "critical",
"message": "APP_KEY is properly set"
},
{
"rule": "app-debug-false-in-production",
"status": "failed",
"severity": "critical",
"message": "APP_DEBUG is enabled in production",
"recommendations": ["Set APP_DEBUG=false in production .env file"]
}
],
"summary": {
"total": 10,
"passed": 8,
"failed": 1,
"warnings": 1
}
}
Clean format without colors, optimized for CI/CD environments.
php artisan safeguard:check --format=ci
Example Output:
Laravel Safeguard Security Check
Environment: production
[PASS] APP_KEY is set
[PASS] CSRF protection enabled
[FAIL] APP_DEBUG is enabled in production
[WARN] Database connection not encrypted
2 issues found, 2 checks passed
Rich HTML format for reports and documentation.
php artisan safeguard:check --format=html > security-report.html
Features:
- Interactive report with collapsible sections
- Color-coded results
- Detailed recommendations
- Summary statistics
- Responsive design
Compatible with test reporting systems.
php artisan safeguard:check --format=junit > security-results.xml
Example Output:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Laravel Safeguard Security Check" tests="4" failures="1" time="0.5">
<testsuite name="Security Rules" tests="4" failures="1" time="0.5">
<testcase name="app-key-is-set" classname="Security" time="0.1"/>
<testcase name="app-debug-false-in-production" classname="Security" time="0.1">
<failure message="APP_DEBUG is enabled in production"/>
</testcase>
</testsuite>
</testsuites>
# Quick check during development
php artisan safeguard:check
# Detailed check with recommendations
php artisan safeguard:check --verbose
# GitHub Actions / GitLab CI
php artisan safeguard:check --format=ci --fail-on-error
# Generate JSON report for processing
php artisan safeguard:check --format=json > security-report.json
# JUnit format for test integration
php artisan safeguard:check --format=junit > security-results.xml
# Generate HTML report
php artisan safeguard:check --format=html > reports/security-report.html
# Generate multiple formats
php artisan safeguard:check --format=json > security.json
php artisan safeguard:check --format=html > security.html
php artisan safeguard:check --format=ci > security.txt
- π CI/CD Integration - Using formats in pipelines
- π§ Commands - Complete command reference
- π‘ Examples - Real-world usage examples
π Home | π§ Commands | π CI/CD Integration | π‘ Examples
Laravel Safeguard - Configurable Security Checks for Laravel Applications
π Home | π¦ Installation | β‘ Quick Start | π‘ Examples | π Full Docs
Made with β€οΈ for the Laravel community
Β© 2025 - Laravel Safeguard by Grazulex