Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Grumphp Laravel Package

phpro/grumphp

GrumPHP is a Composer plugin that installs Git hooks to run quality checks on every commit. It executes configured tasks like tests and linters, blocks failing commits, and helps teams enforce coding standards and best practices automatically.

View on GitHub
Deep Wiki
Context7

A PHP code-quality tool

Frequently asked questions about Grumphp
How do I install GrumPHP in a Laravel project?
Run `composer require --dev phpro/grumphp` in your Laravel project root. This installs GrumPHP as a Composer plugin and registers Git hooks automatically. Ensure PHP, Composer, and Git are in your system PATH for it to work.
Which Laravel versions does GrumPHP support?
GrumPHP works with Laravel 5.5+ (PHP 7.1+). It’s compatible with all modern Laravel versions, including 8.x and 9.x. For older Laravel 5.x projects, ensure PHP 7.1+ is used to avoid compatibility issues.
Can GrumPHP run PHPUnit and Pest tests before commits?
Yes. Configure PHPUnit or Pest tasks in `grumphp.yml` under `tasks`. Example: `phpunit: ~` or `pest: ~`. GrumPHP will execute these tasks on every commit and block the commit if tests fail.
How do I skip GrumPHP checks for a specific commit?
Use `git commit --no-verify` to bypass Git hooks. Alternatively, run `grumphp run --no-assumption` manually to execute checks without committing. This is useful for emergency fixes or CI-only environments.
Does GrumPHP work in CI/CD pipelines without Git hooks?
Yes. Run `grumphp run` as a CI step to enforce checks without relying on Git hooks. This is ideal for environments like GitHub Actions, GitLab CI, or Laravel Forge where hooks may be disabled.
How do I configure GrumPHP for Laravel-specific tasks like laravel-pint?
Add `laravel-pint` to `grumphp.yml` under `tasks` with the correct path. Example: `laravel-pint: ~`. Ensure the task is installed via Composer (`composer require --dev laravel/pint`).
What’s the performance impact of GrumPHP on large Laravel codebases?
GrumPHP is optimized for performance with parallel task execution. Enable it in `grumphp.yml` with `parallel.enabled: true` and adjust `max_workers` (default: 32). For monorepos, configure `hooks_dir` and `git_hook_variables` carefully.
How do I handle Git hook conflicts with existing hooks?
GrumPHP backs up existing hooks during installation. If conflicts occur, manually resolve them by editing `.git/hooks/` or use `--no-scripts` during `composer install` to skip hook registration.
Can GrumPHP enforce stricter rules in production environments?
Yes. Use environment-specific configurations in `grumphp.yml` with `parameters` or custom tasks. Example: Add `phpstan: ~` only for `APP_ENV=production` via conditional logic in your task setup.
What are the alternatives to GrumPHP for Laravel?
Alternatives include Laravel’s built-in `php artisan test` (manual), GitHub Actions for CI checks, or custom scripts with `pre-commit` hooks. However, GrumPHP offers deeper integration with PHP tools (PHPStan, Pest) and Laravel-specific tasks.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky