Security related headers to HTTP responses in Laravel
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!