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.phpconfiguration file - the
intercept-configpublish tag - the
InterceptConfighelper for resolving middleware configuration - the
InterceptServiceProviderfor 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 sharedconfig/intercept.php.
Reading middleware config
Middleware packages should useInterceptConfig::middleware() to read their config safely.
Missing config sections
Missing config sections are safe. For example, a user may publishconfig/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:- merges the default
interceptconfig - exposes the
intercept-configpublish tag
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