hdvinnie / laravel-security-headers
Adds security related headers to HTTP response.
Installs: 26 334
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- illuminate/support: ^6|^7|^8|^9|^10|^11
Requires (Dev)
- ext-json: *
- ext-xdebug: *
- orchestra/testbench: ^3.1|^4.0|^5.0|^6.0|^7.0|^8.0
Suggests
- friendsofphp/php-cs-fixer: Coding style fixer
- phpstan/phpstan: Static analysis tool
- phpunit/phpunit: PHP unit testing framework
README
Security related headers to HTTP responses in Laravel
Installation
Install using composer
composer require hdvinnie/laravel-security-headers
Add service provider in config/app.php
( laravel version < 5.5 )
HDVinnie\SecureHeaders\SecureHeadersServiceProvider::class,
Publish config file
php artisan vendor:publish --provider="HDVinnie\SecureHeaders\SecureHeadersServiceProvider"
Add global middleware in app/Http/Kernel.php
\HDVinnie\SecureHeaders\SecureHeadersMiddleware::class,
Set up config file config/secure-headers.php
Done!