PostToolUse

test-runner.sh

Automatically runs related tests when files are modified. Supports both Pest and PHPUnit test frameworks

Checks Performed

Detect related test files
Run Pest or PHPUnit
Block on test failures

Overview

Automatically runs related tests when files are modified. Supports both Pest and PHPUnit test frameworks. This hook runs on the PostToolUse event.

Configuration

Add this hook to your .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit",
        "command": "bash .claude-plugins/laravel-agent/hooks/scripts/test-runner.sh"
      }
    ]
  }
}