spatie/laravel-csp
Add Content Security Policy (CSP) headers to your Laravel app with easy configuration and preset policies. Control which scripts, styles, images, and connections are allowed, reduce XSS/data exfiltration risk, and support reporting and nonces.
report-only mode to identify and fix violations before enforcing strict policies.self or specific domains).report-only mode).For Executives: "This package lets us lock down our web app against malicious scripts—like credit card theft or data leaks—by controlling which domains our site can interact with. It’s a no-code way to enforce security standards (like PCI for payments or GDPR for user data) without sacrificing functionality. For example, we can safely add Stripe payments or Google Analytics while blocking all other untrusted scripts. It’s a low-effort, high-impact security upgrade that aligns with our compliance goals."
For Engineering: *"Spatie’s Laravel CSP package gives us a maintainable, middleware-based way to enforce Content Security Policy headers. Key benefits:
How can I help you explore Laravel packages today?