promptphp/intercept
PromptPHP Intercept is a Laravel package for capturing, inspecting, and modifying AI prompts and responses before they reach LLM providers, with middleware-style hooks for logging, redaction, caching, and testing.
laravel/ai and gives teams a seam to intercept, inspect, and stub model calls. This directly supports roadmap decisions like "can we add an AI assistant / summarization / classification feature without rewriting our test and observability story?"Adopt when:
laravel/ai — Intercept is designed around that dependency, so fit is near-zero-friction.laravel/ai family as the rest of your stack reduces integration surprises.Look elsewhere when:
laravel/ai (e.g., direct OpenAI/Anthropic SDKs, other frameworks, or non-Laravel services) — Intercept's value is largely scoped to that ecosystem.laravel/ai <1.0 pin is a blocker for your environment — note that Intercept constrains laravel/ai to pre-1.0. If your org is standardizing on laravel/ai 1.0+, you inherit a version conflict until Intercept bumps its constraint.For executives: Intercept gives our Laravel engineering team a stable (v1.0.0) way to test and monitor the AI features we're planning to ship, without paying for live model calls in test environments or building custom tooling from scratch. It is a small, targeted dependency rather than a strategic platform commitment, and it de-risks AI roadmap items by giving us a clean interception layer for logging, cost tracking, and failure handling. The main caveat is that it currently pins laravel/ai below 1.0, so if we standardize on a later version we will depend on the maintainer's release cadence.
For engineering leads: v1.0.0 is an API-stability marker, and the release notes are dominated by docs and a dependency constraint fix rather than new behavior. That is a healthy sign — the surface is settling. Adopt it as the standard seam for AI calls in Laravel so interception logic lives in one place; keep an eye on the laravel/ai <1.0 pin as a tracking item, and treat the small contributor base as a maintenance risk to monitor rather than a reason to avoid adoption.
For engineering: Drop-in with laravel/ai; use it to fake model responses in tests, assert on prompts, and centralize logging/redaction. Watch the laravel/ai version constraint when upgrading that dependency.
How can I help you explore Laravel packages today?