therobfonz/laravel-security-headers
| Install | |
|---|---|
composer require therobfonz/laravel-security-headers |
|
| Latest Version: | 3.1.0 |
| PHP: | ^8.1 |
| Laravel: | 10 · 11 |
| Older releases: | 5 – 9 |
| License: | mit |
| Last Updated: | Nov 20, 2024 |
| Links: | GitHub · Packagist |
Laravel Security Headers
This is a Laravel service provider for adding security header responses to your application.
Installation
The SecurityHeaders Service Provider can be installed via Composer by requiring the
therobfonz/laravel-security-headers package in your project's composer.json.
{
"require": {
"therobfonz/laravel-security-headers": "^3.0"
}
}
Packages are auto-discovered in Laravel 5.6+. Service Providers and Facades are defined in composer.json.
Config File
Publish the confirguration file using Artisan.
php artisan vendor:publish --provider="TheRobFonz\SecurityHeaders\Providers\SecurityHeadersServiceProvider"
Update your settings in the generated config/security.php configuration file.
Configuration
Add the middleware to the 'web' middleware group in App\Http\Kernel.php
protected $middlewareGroups = [
'web' => [
//...
\TheRobFonz\SecurityHeaders\Middleware\RespondWithSecurityHeaders::class,
Nonces
Every inline script tag needs to include the @nonce blade directive in the opening tag.
<script @nonce>
Links
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 3.1.0 | ^8.1 | ^10.0 || | mit | |
| 3.0.0 | ^8.1 | ^10.0 || | mit | |
| 2.0.0 | ^8.1 | ^9.0 || | mit | |
| v1.0.11 | >=7.1.0 || | 5.6.* || | mit | |
| v1.0.10 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.9 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.8 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.7 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.6 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.5 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.4 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.2 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.1 | ^7.1.3 | 5.6.*| | mit | |
| v1.0.0 | ^7.1.3 | 5.6.*| | mit |