PHPackages                             treblle/security-headers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. treblle/security-headers

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

treblle/security-headers
========================

A collection of HTTP middleware classes to improve the security headers in your Laravel application.

0.0.3(2y ago)9534.3k↑47.4%7[2 PRs](https://github.com/Treblle/security-headers/pulls)MITPHPPHP ^8.2

Since May 15Pushed 2y ago5 watchersCompare

[ Source](https://github.com/Treblle/security-headers)[ Packagist](https://packagist.org/packages/treblle/security-headers)[ Docs](https://www.treblle.com/)[ RSS](/packages/treblle-security-headers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

 [![](https://camo.githubusercontent.com/80ee363cd89db70dc5b4f272b14ab23ef6d06eb5551c11ee6d7efd94991aa8ff/68747470733a2f2f747265626c6c652d6769746875622e73332e75732d656173742d312e616d617a6f6e6177732e636f6d2f6769746875622d6865616465722e6a7067)](https://camo.githubusercontent.com/80ee363cd89db70dc5b4f272b14ab23ef6d06eb5551c11ee6d7efd94991aa8ff/68747470733a2f2f747265626c6c652d6769746875622e73332e75732d656173742d312e616d617a6f6e6177732e636f6d2f6769746875622d6865616465722e6a7067)

Treblle Security Headers
========================

[](#treblle-security-headers)

[Integrations](https://docs.treblle.com/en/integrations) • [Website](http://treblle.com/) • [Docs](https://docs.treblle.com) • [Blog](https://blog.treblle.com) • [Twitter](https://twitter.com/treblleapi) • [Discord](https://treblle.com/chat)

---

[![Latest Version](https://camo.githubusercontent.com/33464838819cef594f68c5f72f63b4cdc32e6e9fd932bfc924272177454420ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747265626c6c652f73656375726974792d68656164657273)](https://packagist.org/packages/treblle/security-headers)[![Total Downloads](https://camo.githubusercontent.com/e5a0e36f485e5774dac09761b821015b58339cf01561de8ce2f3415d872a7fd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747265626c6c652f73656375726974792d68656164657273)](https://packagist.org/packages/treblle/security-headers)[![MIT Licence](https://camo.githubusercontent.com/d14d04bdc5526c2e0854c87befdd011808398a0b395b1196079b44296ea67da4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f747265626c6c652f73656375726974792d68656164657273)](LICENSE)[![Tests](https://github.com/treblle/security-headers/actions/workflows/tests.yml/badge.svg)](https://github.com/treblle/security-headers/actions/workflows/tests.yml)

Treblle makes it super easy to understand what’s going on with your APIs and the apps that use them. Just by adding Treblle to your API out of the box you get:

- Real-time API monitoring and logging
- Auto-generated API docs with OAS support
- API analytics
- Quality scoring
- One-click testing
- API management on the go
- and more...

Requirements
------------

[](#requirements)

- PHP 8.2

Installation
------------

[](#installation)

You can install Treblle Security Headers via [Composer](http://getcomposer.org/). Simply run the following command:

```
composer require treblle/security-headers
```

Getting started
---------------

[](#getting-started)

To start, you need to publish the configuration.

```
php artisan vendor:publish --provider="Treblle\SecurityHeaders\Providers\PackageServiceProvider" --tag="security-headers"
```

This is the default content of the config file that will be published at `config/headers.php`:

```
return [
    'remove' => [
        'X-Powered-By',
        'x-powered-by',
        'Server',
        'server',
    ],

    'referrer-policy' => 'no-referrer-when-downgrade',

    'strict-transport-security' => 'max-age=31536000; includeSubDomains',

    'certificate-transparency' => 'enforce, max-age=30',

    'permissions-policy' => 'autoplay=(self), camera=(), encrypted-media=(self), fullscreen=(), geolocation=(self), gyroscope=(self), magnetometer=(), microphone=(), midi=(), payment=(), sync-xhr=(self), usb=()',

    'content-type-options' => 'nosniff',
];
```

Community 💙
-----------

[](#community-)

First and foremost: **Star and watch this repository** to stay up-to-date.

Also, follow our [Blog](https://blog.treblle.com), and on [Twitter](https://twitter.com/treblleapi).

You can chat with the team and other members on [Discord](https://treblle.com/chat) and follow our tutorials and other video material at [YouTube](https://youtube.com/@treblle).

[![Treblle Discord](https://camo.githubusercontent.com/f101f9a6a1d7b04360e851493c6bc9b783d50abacda6d48dfed7dc7a92cd3c16/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547265626c6c65253230446973636f72642d4a6f696e2532306f7572253230446973636f72642d4633463546433f6c6162656c436f6c6f723d373238394441267374796c653d666f722d7468652d6261646765266c6f676f3d646973636f7264266c6f676f436f6c6f723d463346354643266c696e6b3d68747470733a2f2f747265626c6c652e636f6d2f63686174)](https://treblle.com/chat)

[![Treblle YouTube](https://camo.githubusercontent.com/cb408aa60a1885a207f95311953a6e5560486a95337a56e1816ec60d63a099a3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547265626c6c65253230596f75547562652d5375627363726962652532306f6e253230596f75547562652d4633463546433f6c6162656c436f6c6f723d633433303262267374796c653d666f722d7468652d6261646765266c6f676f3d596f7554756265266c6f676f436f6c6f723d463346354643266c696e6b3d68747470733a2f2f796f75747562652e636f6d2f40747265626c6c65)](https://youtube.com/@treblle)

[![Treblle on Twitter](https://camo.githubusercontent.com/a6229cf2c334992f33e457813feeba38b04f438da22d301c284a8c8f48f02132/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547265626c6c652532306f6e253230547769747465722d466f6c6c6f7725323055732d4633463546433f6c6162656c436f6c6f723d314441314632267374796c653d666f722d7468652d6261646765266c6f676f3d54776974746572266c6f676f436f6c6f723d463346354643266c696e6b3d68747470733a2f2f747769747465722e636f6d2f747265626c6c65617069)](https://twitter.com/treblleapi)

### How to contribute

[](#how-to-contribute)

Here are some ways of contributing to making Treblle better:

- **[Try out Treblle](https://docs.treblle.com/en/introduction#getting-started)**, and let us know ways to make Treblle better for you. Let us know here on [Discord](https://treblle.com/chat).
- Join our [Discord](https://treblle.com/chat) and connect with other members to share and learn from.
- Send a pull request to any of our [open source repositories](https://github.com/treblle) on Github. Check the contribution guide on the repo you want to contribute to for more details about how to contribute. We're looking forward to your contribution!

### Contributors

[](#contributors)

[ ![A table of avatars from the project's contributors](https://camo.githubusercontent.com/41b0c3e5879c5fa279f0ae63c114985e6d7b05c71d04480d0c54a881d24a2d81/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d747265626c6c652f73656375726974792d68656164657273)](https://github.com/treblle/security-headers/graphs/contributors)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

3

Last Release

1078d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a87fe82b349821ebd49cf57d65c4cd3e33ae0833222a8438d90fe8921ca899ea?d=identicon)[JustSteveKing](/maintainers/JustSteveKing)

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (5 commits)")[![lee-to](https://avatars.githubusercontent.com/u/1861327?v=4)](https://github.com/lee-to "lee-to (1 commits)")

---

Tags

application-securitybackendclassescollectionhttplaravellaravel-packagemiddlewarephpsecurity-headersapilaravelmonitoringdocumentationdebugingtreblle

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/treblle-security-headers/health.svg)

```
[![Health](https://phpackages.com/badges/treblle-security-headers/health.svg)](https://phpackages.com/packages/treblle-security-headers)
```

###  Alternatives

[treblle/treblle-laravel

Stay in tune with your APIs

135204.9k](/packages/treblle-treblle-laravel)[treblle/treblle-api-tools-laravel

A set of useful tools for building APIs in Laravel.

135.3k1](/packages/treblle-treblle-api-tools-laravel)[treblle/treblle-php

Stay in tune with your APIs

2067.0k2](/packages/treblle-treblle-php)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1065.8k](/packages/moesif-moesif-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
