CorsPlugin
Registers CorsMiddleware through the generic plugin seam, opt-in via cors.enabled (the middleware itself no-ops when it’s false, so simply installing this package doesn’t turn CORS on for every app).
Synopsis
Section titled “Synopsis”final class CorsPlugin implements PluginInterface
| Implements | PluginInterface |
| Source | CorsPlugin.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
register(PluginRegistrar $registrar): void | Registers the CORS configuration defaults and the middleware itself. |
register()
Section titled “register()”public function register(PluginRegistrar $registrar): void
Registers the CORS configuration defaults and the middleware itself.
cors.enabled defaults to false, so installing the package alone does not switch CORS on. The middleware is registered through its #[Middleware] attribute, which places it in the pipeline.
| Parameter | Type | Description |
|---|---|---|
$registrar | PluginRegistrar |