Skip to content

Installation & first scan

PHP 8.2 or newer, Composer, and the json and mbstring PHP extensions. Run the command in the project you want to analyze.

Terminal window
composer require --dev goktugcy/worker-safety

In a Laravel application that is all you need: the package registers an Artisan command through package discovery. See Laravel below.

Terminal window
# Scan the configured paths, or the framework defaults
vendor/bin/worker-safety scan
# Scan specific directories
vendor/bin/worker-safety scan app src
# Fail a CI build on HIGH findings
vendor/bin/worker-safety scan --fail-on=high
# Machine-readable output
vendor/bin/worker-safety scan --format=json
vendor/bin/worker-safety scan --format=sarif > worker-safety.sarif

Optionally write a configuration file first:

Terminal window
vendor/bin/worker-safety init