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.

Run every applicable check

php artisan larabeacon

The summary separates performance, security, and reliability. A failed or errored analyzer returns exit code 1 unless it has been excluded from reporting; a clean run returns 0.

Show finding details

php artisan larabeacon --details

Detailed 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 --details

CI 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 --ci
A baseline is a decision, not a cleanup command

The 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.json

Detailed 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

OptionPurpose
--profile=local|ci|productionSelect checks for the actual environment.
--preflightDescribe scan prerequisites without running analyzers.
--format=json|markdown|sarifExport local findings and remediation guidance.
--output=<file>Write a structured report to a file instead of stdout.
--baseline=<file> --only-newGate findings not covered by a current acceptance entry.
--fail-on=majorBlock major and critical findings; execution errors still block.
--fix-previewShow reviewable diffs for supported deterministic fixes.
--branch=<name>Separate Cloud report history by supplied branch.
--detailsPrint detailed output for failed checks.
--ciApply the CI analyzer filter and retain deterministic exit behavior.
--show-exceptionsPrint analyzer exception stack traces in the local terminal.
--reportSubmit 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.
--reviewMark the submitted report as requesting a repository review.