Automated code analysis for Laravel applications covering security, performance, reliability, code quality and best practices.
Automated code analysis for Laravel applications — 73 open-source analyzers covering security, performance, reliability, code quality, and best practices.
Built on top of shieldci/analyzers-core - a shared, framework-agnostic foundation for static analysis tools.
This package uses shieldci/analyzers-core for its core analyzer functionality, providing:
composer require shieldci/laravelConfiguration
Publish the configuration file:
php artisan vendor:publish --tag=shieldci-config
Add your ShieldCI credentials to .env (your API token is displayed when you create a project in the ShieldCI dashboard):
SHIELDCI_TOKEN=your-api-token SHIELDCI_PROJECT_ID=your-project-idUsage
Run the analysis:
php artisan shield:analyzeOptions
Run a specific analyzer:
php artisan shield:analyze --analyzer=sql-injection
Run analyzers by category:
php artisan shield:analyze --category=security
Output as JSON:
php artisan shield:analyze --format=json
Save report to file:
php artisan shield:analyze --output=report.json
Send results to ShieldCI platform:
php artisan shield:analyze --report
Schedule analysis with trigger tracking:
// Laravel 11+ (routes/console.php) Schedule::command('shield:analyze --triggered-by=scheduled --report')->daily(); // Laravel 11+ (bootstrap/app.php) ->withSchedule(function (Schedule $schedule) { $schedule->command('shield:analyze --triggered-by=scheduled --report')->daily(); }) // Laravel 9-10 (app/Console/Kernel.php) $schedule->command('shield:analyze --triggered-by=scheduled --report')->daily();Advanced FeaturesBaseline Support (Gradual Adoption)
Generate a baseline to suppress existing issues and only catch new ones:
# Generate baseline from current state (all analyzers, respects config) php artisan shield:baseline # Generate baseline for CI mode (only CI-compatible analyzers) php artisan shield:baseline --ci # Merge with existing baseline php artisan shield:baseline --merge # Analyze against baseline (only NEW issues reported) php artisan shield:analyze --baselineCI Mode (Optimized for CI/CD)
Skip slow or network-dependent analyzers in CI/CD:
# Run in CI mode (only CI-compatible analyzers)
php artisan shield:analyze --ci
Whitelist/blacklist specific analyzers in config/shieldci.php:
'ci_mode_analyzers' => ['sql-injection', 'xss-vulnerabilities', 'csrf-protection'], 'ci_mode_exclude_analyzers' => ['vulnerable-dependencies', 'frontend-vulnerable-dependencies'],Don't Report (Exit Code Control)
Run informational analyzers without failing CI:
// config/shieldci.php 'dont_report' => [ 'missing-docblock', // Informational only 'commented-code', // Won't fail CI ],Compact Output
Limit displayed issues per check:
# Show only 3 issues per check
SHIELDCI_MAX_ISSUES=3 php artisan shield:analyze
Environment-Aware AnalyzersSome analyzers are only relevant in specific environments. ShieldCI automatically handles multi-environment setups through environment mapping.
Standard environments (no configuration needed):
local - Local developmentdevelopment - Development serverstaging - Staging/pre-productionproduction - Productiontesting - Automated testingCustom environments (configure mapping):
// config/shieldci.php 'environment_mapping' => [ 'production-us' => 'production', 'production-eu' => 'production', 'staging-preview' => 'staging', 'prod-1' => 'production', ],
How it works:
['production', 'staging'])Example: AutoloaderOptimizationAnalyzer only runs in production/staging environments.
Available AnalyzersShieldCI includes 73 comprehensive analyzers across five categories:
| Category | Count | Coverage |
|---|---|---|
| Security | 22 | Complete OWASP Top 10 2021 |
| Performance | 18 | Optimize speed and efficiency |
| Reliability | 13 | Ensure stability and correctness |
| Code Quality | 5 | Improve maintainability |
| Best Practices | 15 | Laravel-specific patterns |
→ Full Analyzer Reference — all 73 analyzers with examples and fix guidance
ShieldCI ProShieldCI Pro adds 82 advanced analyzers on top of the free package:
| Category | Count | Coverage |
|---|---|---|
| Security | 45 | Enterprise-grade vulnerability detection |
| Performance | 15 | Advanced performance optimization |
| Reliability | 15 | Production-grade resilience checks |
| Best Practices | 4 | Laravel architecture and conventions |
| Code Quality | 3 | Test coverage and quality analysis |
Highlights:
See config/shieldci.php for all available configuration options.
Configure when the analysis should fail:
'fail_on' => 'critical', // never, critical, high, medium, low 'fail_threshold' => 80, // Minimum score to pass (0-100)Paths
Configure which paths to analyze:
'paths' => [ 'analyze' => ['app', 'config', 'database', 'routes'], ], 'excluded_paths' => [ 'vendor/*', 'node_modules/*', 'storage/*', ],Creating Custom Analyzers
Quick example:
<?php namespace ShieldCI\Analyzers\Security; use ShieldCI\AnalyzersCore\Abstracts\AbstractFileAnalyzer; use ShieldCI\AnalyzersCore\Contracts\ResultInterface; use ShieldCI\AnalyzersCore\ValueObjects\{AnalyzerMetadata, Location}; use ShieldCI\AnalyzersCore\Enums\{Category, Severity}; class MyAnalyzer extends AbstractFileAnalyzer { protected function metadata(): AnalyzerMetadata { return new AnalyzerMetadata( id: 'my-analyzer', name: 'My Custom Analyzer', description: 'Checks for custom security issues', category: Category::Security, severity: Severity::High, ); } protected function runAnalysis(): ResultInterface { // Your analysis logic $issues = []; foreach ($this->getPhpFiles() as $file) { // Analyze files } return empty($issues) ? $this->passed('No issues found') : $this->failed('Issues detected', $issues); } }Testing
composer test # 4,000+ tests composer test-coverage # 98%+ code coverage composer analyse # PHPStan Level 9Documentation
MIT License. See LICENSE file for details.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | laravel-workflow/waterline (2.0.0-rc.1) | 0 | 21.11 | 28-07-2026 |
| 2 | durable-workflow/waterline (2.0.0-rc.1) | 0 | 21.11 | 28-07-2026 |
| 3 | laravel-workflow/laravel-workflow (2.0.0-rc.1) | 0 | 18.33 | 28-07-2026 |
| 4 | artisanpack-ui/visual-editor (1.5.3) | 0 | 24.06 | 28-07-2026 |
| 5 | seip25/lila-php (v1.59) | 0 | 38 | 28-07-2026 |
| 6 | Rocky Linux ruby Important Command Injection Threat RLSA-2026-33514 | 0 | 5 | 30-06-2026 |
| 7 | moaines/illumi-search (1.21.4) | 0 | 37.46 | 28-07-2026 |
| 8 | linkrobins/birdseye (v1.5.0) | 0 | 14.17 | 28-07-2026 |
| 9 | vortos/vortos-deploy (v1.0.0-alpha-298) | 0 | 29.98 | 28-07-2026 |
| 10 | deminy/counit (1.0.2) | 0 | 13.78 | 28-07-2026 |