PHPackages                             mazedlx/laravel-feature-policy - 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. [Security](/categories/security)
4. /
5. mazedlx/laravel-feature-policy

ActiveLibrary[Security](/categories/security)

mazedlx/laravel-feature-policy
==============================

Add Feature-Policy headers to the responses of a Laravel app

v2.4(2mo ago)17200.7k↓44.8%8[1 issues](https://github.com/mazedlx/laravel-feature-policy/issues)[2 PRs](https://github.com/mazedlx/laravel-feature-policy/pulls)MITPHPPHP ^8.1|^8.2CI passing

Since Aug 28Pushed 4d ago2 watchersCompare

[ Source](https://github.com/mazedlx/laravel-feature-policy)[ Packagist](https://packagist.org/packages/mazedlx/laravel-feature-policy)[ RSS](/packages/mazedlx-laravel-feature-policy/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (12)Versions (30)Used By (0)

Configure the browsers abilities
================================

[](#configure-the-browsers-abilities)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dc13aa461075898828aba933e4746c4f43317777a8532b56f6f775e39e210182/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617a65646c782f6c61726176656c2d666561747572652d706f6c6963792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mazedlx/laravel-feature.policy)[![Tests](https://github.com/mazedlx/laravel-feature-policy/actions/workflows/test.yml/badge.svg)](https://github.com/mazedlx/laravel-feature-policy/actions/workflows/test.yml)[![Analyse and format](https://github.com/mazedlx/laravel-feature-policy/actions/workflows/code-quality.yml/badge.svg)](https://github.com/mazedlx/laravel-feature-policy/actions/workflows/code-quality.yml)[![Total Downloads](https://camo.githubusercontent.com/ce0bdf6cc894d9784e9f7974e772794ac84f39450cb811bec4d33a97d61dafc6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617a65646c782f6c61726176656c2d666561747572652d706f6c6963792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mazedlx/laravel-feature-policy)

The Permissions-Policy, which [previously](https://docs.w3cub.com/http/headers/feature-policy) was known as the Feature-Policy. But since it came out of draft, it was renamed to "Permissions-Policy".
The "Permissions-Policy" is an HTTP header which can be used to restrict the abilities of a browser.

Where the Content-Security-Policy focuses on security, the "Permissions-Policy" focuses on allowing or disabling the abilities of the browser.
This can be done though the HTTP header, which this package focuses on, but it can also do this through the `allows` attribute on the `iframe` element.

iframe example```

```

More on the header itself can be found on the following sites.

- [Feature Policy | Smashing Magazine](https://www.smashingmagazine.com/2018/12/feature-policy/)
- [Feature Policy | Google Developers](https://developer.chrome.com/blog/feature-policy/)
- [W3C](https://www.w3.org/TR/permissions-policy/)

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

[](#installation)

**Laravel 10 users should use v2.0 or newer, otherwise stick to v1.3**

The package can be installed though composer:

```
$ composer require mazedlx/laravel-feature-policy
```

After which the config file needs to be published:

```
$ php artisan vendor:publish --provider="Mazedlx\FeaturePolicy\FeaturePolicyServiceProvider" --tag="config"
```

Which looks like this:

Config file```
