NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #941 most downloaded on Packagist
Add CSP headers to the responses of a Laravel app
Latest stable
3.31.1
Last release 16 days ago
06 Nov 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
93 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Fix the Maze preset by allowing https://api.maze.co in connect-src alongside the existing https://prompts.maze.co, and https://t.maze.co in frame-src,
https://api.maze.co in connect-src alongside the existing https://prompts.maze.co, and https://t.maze.co in frame-src, matching Maze's granular CSP guidance.script-src https://snippet.maze.co; no wildcards or unrelated preset permissions are added. Update the exact-output preset snapshot.No API, dependency requirement, or supported-version changes in this patch. Applications with additional CSP headers should ensure those policies also permit the Maze endpoints where intended.
Thanks to @chinmaypurav for the fix in https://github.com/spatie/laravel-csp/pull/232.
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.31.0...3.31.1
Add a Featurebase preset by @kachelle in https://github.com/spatie/laravel-csp/pull/230
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.30.1...3.31.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Fix the HotJar preset for the Hotjar-to-Contentsquare migration by allowing https://*.hotjar.io for scripts and images. Existing connection, WebSocket
No API, dependency requirement or supported-version changes. Applications that explicitly define script-src-elem must also add https://*.hotjar.io there; otherwise script elements inherit script-src as before. See Hotjar's migration FAQ.
Thanks to @jackbayliss for the contribution in https://github.com/spatie/laravel-csp/pull/228.
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.30.0...3.30.1
Add the trusted-types CSP directive and the allow-duplicates keyword, with documentation and regression coverage for enforcing and report-only policie
Thanks to @alex-ng-wesoft for the original contribution in #227.
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.29.0...3.30.0
Add Google Ads preset by @jhhazelaar in https://github.com/spatie/laravel-csp/pull/226
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.28.3...3.29.0
Fix Intercom preset conflicting with Basic preset by @Seb33300 in https://github.com/spatie/laravel-csp/pull/224
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.28.2...3.28.3
Add FONT directive to Cloudflare CDN preset by @Seb33300 in https://github.com/spatie/laravel-csp/pull/225
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.28.1...3.28.2
Add child-src to the Sentry preset and correct its comment by @freekmurze in https://github.com/spatie/laravel-csp/pull/223
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.28.0...3.28.1
Remove dead matrix excludes by @freekmurze in https://github.com/spatie/laravel-csp/pull/220
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.27.0...3.28.0
chore: update snapshots to Pest V4 by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/216
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.26.0...3.27.0
Add a There There preset by @freekmurze in https://github.com/spatie/laravel-csp/pull/213
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.25.1...3.26.0
Chore: add Algolia insights domain by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/212
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.25.0...3.25.1
Support separate report endpoints for the report-only CSP policy by @freekmurze in https://github.com/spatie/laravel-csp/pull/211
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.24.1...3.25.0
Add Directive::IMG:Scheme::DATA for Bootstrap by @weshooper in https://github.com/spatie/laravel-csp/pull/209
Directive::IMG:Scheme::DATA for Bootstrap by @weshooper in https://github.com/spatie/laravel-csp/pull/209Full Changelog: https://github.com/spatie/laravel-csp/compare/3.24.0...3.24.1
Remove deprecated block-all-mixed-content directive from README by @weshooper in https://github.com/spatie/laravel-csp/pull/206
block-all-mixed-content directive from README by @weshooper in https://github.com/spatie/laravel-csp/pull/206Full Changelog: https://github.com/spatie/laravel-csp/compare/3.23.1...3.24.0
Switch to scoped singletons to support Laravel Octane by @m-fi in https://github.com/spatie/laravel-csp/pull/205
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.23.0...3.23.1
## What's Changed - Add Laravel 13 support
Update README.md by @MartinCamen in https://github.com/spatie/laravel-csp/pull/201
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.21.0...3.22.0
feat: Add Rollbar CSP preset by @MoT3rror in https://github.com/spatie/laravel-csp/pull/200
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.20.0...3.21.0
Google Maps Preset by @nessimabadi in https://github.com/spatie/laravel-csp/pull/199
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.19.0...3.20.0
feat: Chargebee CSP Preset by @shawnhooper in https://github.com/spatie/laravel-csp/pull/197
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.18.0...3.19.0
Feat: add SurveyMonkey preset by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/196
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.17.2...3.18.0
Fix: update JsDelivr preset to include connect-src directive by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/195
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.17.1...3.17.2
Update issue template by @AlexVanderbist in https://github.com/spatie/laravel-csp/pull/193
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.17.0...3.17.1
Chore: add missing tests for presets by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/192
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.16.0...3.17.0
feat: add bootstrap preset by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/189
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.15.0...3.16.0
feat: sentry preset added by @chinmaypurav in https://github.com/spatie/laravel-csp/pull/182
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.14.0...3.15.0
Update README.md Vite Nonce Generator Imports by @nessimabadi in https://github.com/spatie/laravel-csp/pull/180
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.13.1...3.14.0
Docs| Hint the usage of a base64-value for generated nonces by @YasserB94 in https://github.com/spatie/laravel-csp/pull/177
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.13.0...3.13.1
Adds Hireroad/Vacancy Filler Recruitment Preset by @atomicjam in https://github.com/spatie/laravel-csp/pull/176
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.12.0...3.13.0
Add Policy@setReportUri() method by @hivokas in https://github.com/spatie/laravel-csp/pull/175
Policy@setReportUri() method by @hivokas in https://github.com/spatie/laravel-csp/pull/175Full Changelog: https://github.com/spatie/laravel-csp/compare/3.11.1...3.12.0
Use correct format for directives by @adamjgriffith in https://github.com/spatie/laravel-csp/pull/167
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.11.0...3.11.1
Allow tag manager noscript fallback by @adamjgriffith in https://github.com/spatie/laravel-csp/pull/166
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.10.0...3.11.0
Add configuration for Vite hot reloading by @ziadoz in https://github.com/spatie/laravel-csp/pull/165
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.9.0...3.10.0
Add HotJar preset by @ziadoz in https://github.com/spatie/laravel-csp/pull/163
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.8.2...3.9.0
Update README.md by @nessimabadi in https://github.com/spatie/laravel-csp/pull/162
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.8.1...3.8.2
Captcha Services Presets by @atomicjam in https://github.com/spatie/laravel-csp/pull/160
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.8.0...3.8.1
Preset for Meta Pixels by @atomicjam in https://github.com/spatie/laravel-csp/pull/159
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.7.0...3.8.0
Add Vimeo preset by @rbibby in https://github.com/spatie/laravel-csp/pull/158
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.6.0...3.7.0
3 Presets (Stripe, Plausible, TicketTailor) by @atomicjam in https://github.com/spatie/laravel-csp/pull/156
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.5.0...3.6.0
docs: remove return from v3 upgrade guide by @audunru in https://github.com/spatie/laravel-csp/pull/153
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.4.0...3.5.0
Add Cloudflare Web Analytics preset by @ohiader in https://github.com/spatie/laravel-csp/pull/152
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.3.0...3.4.0
Google TLDs CSP preset by @christianschoenmakers in https://github.com/spatie/laravel-csp/pull/148
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.2.0...3.3.0
Intercom preset by @christianschoenmakers in https://github.com/spatie/laravel-csp/pull/147
Full Changelog: https://github.com/spatie/laravel-csp/compare/3.1.0...3.2.0
Update migration guide to use $policy by @patrickomeara in https://github.com/spatie/laravel-csp/pull/144
$policy by @patrickomeara in https://github.com/spatie/laravel-csp/pull/144Full Changelog: https://github.com/spatie/laravel-csp/compare/3.0.0...3.1.0
The development goal for version 3 was to reduce the boilerplate of configuring a policy for common services like Google Tag Manager, Fathom Analytics
The development goal for version 3 was to reduce the boilerplate of configuring a policy for common services like Google Tag Manager, Fathom Analytics, Adobe Fonts… In addition, we've made it easier to add your own directives through your configuration file, without writing additional code.
For more information, read our blog post on the v3 release.
Upgrading from v2? We have an upgrade guide!
Add support for Laravel 12 by @mfn in https://github.com/spatie/laravel-csp/pull/136
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.10.2...2.10.3
Fix getting Blade compiler by @CicerBro in https://github.com/spatie/laravel-csp/pull/134
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.10.1...2.10.2
Update README.md by @federico-boncaldo in https://github.com/spatie/laravel-csp/pull/127
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.10.0...2.10.1
feat: added missing 'wasm-unsafe-eval' keyword by @fxnm in https://github.com/spatie/laravel-csp/pull/125
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.9.0...2.10.0
Fix incorrect namespaces in README.md by @dnwjn in https://github.com/spatie/laravel-csp/pull/121
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.8.4...2.9.0
Removed expired link from readme file by @DevYunus in https://github.com/spatie/laravel-csp/pull/118
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.8.3...2.8.4
Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/laravel-csp/pull/109
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.8.2...2.8.3
Add wss: (secure websocket) scheme support by @bitwise-operators in https://github.com/spatie/laravel-csp/pull/105
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.8.1...2.8.2
Lazily register blade directives by @axlon in https://github.com/spatie/laravel-csp/pull/104
Full Changelog: https://github.com/spatie/laravel-csp/compare/2.8.0...2.8.1
Fixing readme issues by @lukeclifton in https://github.com/spatie/laravel-csp/pull/88
@cspMetaTag blade directive by @lukeraymonddowning in https://github.com/spatie/laravel-csp/pull/103Full Changelog: https://github.com/spatie/laravel-csp/compare/2.7.0...2.8.0
- support Laravel 9
- add support for PHP 8
- add prefetch-src directive
- add unsafe-hashes keyword
One column per quarter.