Getting started
Running LaraBeacon
The command discovers applicable analyzers, executes them in the current Laravel application, prints category totals, and exits with a status your release process can use.
Where to run which checks
Many checks describe the environment the command runs in: caching, the optimized autoloader, PHP settings, debug mode, HTTPS headers. On your laptop they describe your laptop, not your server. Pick the profile that matches where the command runs.
| Where | Command | What it covers |
|---|---|---|
| Your machine | --profile=local | The CI-safe code checks. Environment-specific production checks are skipped, so your local settings are not judged as if they were production. |
| CI pipeline | --profile=ci | Deterministic code checks only, the same on every run. See Continuous integration. |
| Production or staging | --profile=production | Everything, including the server's PHP, cache, queue and HTTP configuration. Requires APP_ENV production, prod, live or staging. |
Without a profile, every check runs and the environment checks judge whatever configuration is loaded. Installing with composer require --dev keeps LaraBeacon off servers deployed with composer install --no-dev. To cover production settings, either run the production profile on a staging server that mirrors production and has development dependencies installed, or install LaraBeacon as a regular dependency (without --dev) and run php artisan larabeacon --profile=production on the server after a deployment. LaraBeacon only runs when you call the command.
A check that does not apply prints Not Applicable with the reason, for example that APP_ENV is local or the application is not served over HTTPS.
Run every applicable check
php artisan larabeaconThe summary separates performance, security, and reliability. With Core 3.5 or newer, a Findings by severity list follows: critical first, then major, minor and info, each with a link to the check page. A failed or errored analyzer returns exit code 1 unless it has been excluded from reporting; a clean run returns 0. Use --fail-on=major to fail only on critical and major findings.
Show finding details
php artisan larabeacon --detailsDetailed output includes paths, line numbers, and analyzer messages where the check can identify them. Add --show-exceptions when diagnosing an analyzer error itself.
Run selected analyzers
Pass one or more fully qualified analyzer class names after the command.
php artisan larabeacon \
'BaerSoftware\LaraBeacon\Analyzers\Security\CSRFAnalyzer'This is useful while remediating one finding. A full scan should still run before release.
CI mode
php artisan larabeacon --ci --detailsCI mode skips analyzers listed in ci_mode_exclude_analyzers. Use it for deterministic pipeline checks, then run environment-dependent analyzers against a representative release candidate.
Create a baseline
After reviewing the current findings, write them to the published configuration:
php artisan larabeacon:baseline --ciThe command resets existing ignored errors before rebuilding the baseline. Review and commit the resulting config/larabeacon.php change so accepted risk has an owner and history.
Local reports and repair guidance
These workflows require LaraBeacon Core 3.1.0 or newer.
php artisan larabeacon --profile=local --details
php artisan larabeacon --profile=ci --format=markdown --output=larabeacon.md
php artisan larabeacon --format=json --fix-preview --output=larabeacon.jsonDetailed findings include risk, confidence, recommended changes and verification. Markdown reports can give a coding agent a scoped repair task; always review the result. JSON and SARIF support other tools without a Cloud account. Source snippets and stack traces are excluded from local reports.
Fix previews show diffs for supported deterministic cases and never edit files. The initial rules cover literal production debug configuration and environment lookups with one unambiguous configuration mapping.
Use --profile=production --preflight to inspect the booted environment before a full runtime scan. The profile requires an actual production-like configuration and does not change APP_ENV. Preflight does not contact or verify runtime services.
Command options
| Option | Purpose |
|---|---|
--profile=local|ci|production | Select checks for the actual environment. |
--preflight | Describe scan prerequisites without running analyzers. |
--format=json|markdown|sarif | Export local findings and remediation guidance. |
--output=<file> | Write a structured report to a file instead of stdout. |
--baseline=<file> --only-new | Gate findings not covered by a current acceptance entry. |
--fail-on=major | Block major and critical findings; execution errors still block. |
--fix-preview | Show reviewable diffs for supported deterministic fixes. |
--branch=<name> | Separate Cloud report history by supplied branch. |
--details | Print detailed output for failed checks. |
--ci | Apply the CI analyzer filter and retain deterministic exit behavior. |
--show-exceptions | Print analyzer exception stack traces in the local terminal. |
--report | Submit this run to a configured LaraBeacon Cloud endpoint. |
--hash=<sha> | Attach an explicit commit identifier to a Cloud report. |
--issue=<number> | Attach a pull-request or issue number to a Cloud report. |
--review | Mark the submitted report as requesting a repository review. |