Skip to main content
promptphp/intercept-support provides shared support utilities and configuration for the Intercept middleware ecosystem. Most users do not need to install or use this package directly. It is installed automatically when required by an Intercept middleware package. The support package provides shared infrastructure used across Intercept packages including
  • the shared config/intercept.php configuration file
  • the intercept-config publish tag
  • the InterceptConfig helper for resolving middleware configuration
  • the InterceptServiceProvider for Laravel package registration

Installation

You usually do not need to install this package directly. It is installed automatically when installing an Intercept middleware package. If needed, you can install it directly:

Configuration

See configuration for details on the shared config/intercept.php.

Reading middleware config

Middleware packages should use InterceptConfig::middleware() to read their config safely.
The helper merges the published config section with the middleware’s internal defaults. If the section is missing, the defaults are returned.

Missing config sections

Missing config sections are safe. For example, a user may publish config/intercept.php while only using Injection Guard. If they later install PII Redactor, their existing config file may not contain a pii_redactor section. That is fine. PII Redactor will still work using its internal defaults. Users only need to add a middleware section to config/intercept.php when they want to customise global behaviour.

Service provider

This package registers the shared Intercept service provider:
The provider:
  • merges the default intercept config
  • exposes the intercept-config publish tag
Laravel package auto-discovery should register this provider automatically. If auto-discovery is unavailable, register the provider manually in bootstrap/providers.php:

For middleware package authors

Each Intercept middleware package should:
  • require promptphp/intercept-support
  • define its own internal defaults
  • read global config through InterceptConfig::middleware()
  • work even if its config section is missing
  • avoid publishing its own separate config file
Example:
This keeps the Intercept ecosystem consistent while allowing each middleware package to remain independently installable.