netbrothers-gmbh/nbcsb-bundle
NetBrothers Content Security Bundle (NBCSB) adds Content Security Policy support to Symfony apps. Configure CSP directives, nonces, and reporting from bundle configuration to restrict allowed content sources and improve protection against XSS and injection attacks.
composer require <vendor>/<package>. v3.0.0 requires Symfony >=7 <8, which pins the practical floor to Laravel 11+ and PHP 8.2+. On Laravel 10 or older, Composer will refuse to resolve; stay on the 2.x line.php artisan vendor:publish --provider="<Vendor>\<Package>\<PackageServiceProvider>" (or the tagged variants the README lists) and review what lands in config/. Most behaviour in this package is config-driven, so read that file end-to-end before writing code.app(). This keeps it swappable in tests and lets you bind a fake/decorator in a test service provider.config/<package>.php and only expose the values that genuinely differ per environment (credentials, endpoints, driver names) as env() calls. Commit the config; never commit .env.config('package.enabled')) so a bad deploy is a config revert rather than a code revert.Http::fake(), Queue::fake(), and Event::fake() around it rather than hitting real services. For DB-touching packages, RefreshDatabase plus a factory for the package's models covers most cases.EventServiceProvider entry so package upgrades don't silently reorder your hooks.symfony/* constraint, pin the package to ^3.0 only in apps already on Symfony 7 components, and let older apps float at ^2.0. A composer why-not <vendor>/<package> 3.0 run tells you exactly which dependency is blocking.>=7 <8 is not a cosmetic constraint update — it drops Laravel 10 and PHP 8.1 support and will fail resolution on those stacks. Treat v3.0.0 as a major upgrade requiring a Laravel major upgrade alongside it, not a drop-in patch.composer why-not. If install fails, composer why-not <vendor>/<package> ^3.0 names the conflicting package. The usual culprits are older symfony/console, symfony/http-foundation, or a third-party package still capped at Symfony 6..gitignore files are housekeeping, not behaviour. They typically sit in cache/storage/log directories so empty runtime dirs survive version control. Two consequences: vendor/ copies of the package may now contain .gitignore stubs your deploy script didn't expect, and rsync/git archive pipelines that exclude dotfiles will drop them. Check deploy scripts if you vendor or mirror the package..gitignore additions to fix permission errors. If published storage/cache directories are unwritable, that's a filesystem/ownership issue; the package can't solve it.php artisan config:clear && php artisan cache:clear && composer dump-autoload. Config caching is the number one cause of "the new version didn't change anything."Macroable traits on the package's classes, and custom driver/resolver registration. These are the sanctioned ways to adapt behaviour; avoid subclassing internals, which is where major-version churn bites.How can I help you explore Laravel packages today?