Introduction
Installation
Install Sheath in a Laravel application, publish its configuration, and enable the rules needed for day-to-day linting.
#Requirements
- PHP 8.2+
- Laravel 12 or 13
#Install the Package
composer require fortephp/sheath --dev
Laravel service discovery registers Sheath automatically. If you are experiencing issues after installation, please consult the Troubleshooting guide.
#Publish the Starter Config
php artisan vendor:publish --tag=sheath-config
This publishes config/sheath.php, which gives you:
- default lint paths
- default ignore patterns
- a starter ruleset
- package requirement behavior
The published config is a starting profile, not an exhaustive dump of every built-in rule. Sheath itself ships with a larger rule inventory than the starter config enables explicitly.
#Verify the Install
php artisan sheath:lint --print-config
If the command resolves and prints configuration, the package is installed correctly.
The printed configuration also includes a ruleStatus section showing which
rules will actually run. See
packageRequirementMode.
#Optional: Parallel Processing Support
Sheath can run in parallel with --parallel on Linux, macOS, and Windows. The underlying runtime support is optional, so install the suggested packages if you want multi-process linting:
composer require --dev react/event-loop react/child-process clue/ndjson-react fidry/cpu-core-counter
Then run:
php artisan sheath:lint --parallel
If the runtime pieces are unavailable, Sheath warns and falls back to sequential linting.
#First Run
# lint the configured default paths
php artisan sheath:lint
# apply safe fixes
php artisan sheath:lint --fix
# preview all available fixes without writing
php artisan sheath:lint --dry-run --dangerous
#Editor and Tooling Integration
For editor or CI integrations, use a structured reporter:
# JSON for custom tooling
php artisan sheath:lint --format=json
# Checkstyle XML for tools that explicitly accept the schema
php artisan sheath:lint --format=checkstyle --output=sheath-report.xml