PHPackages                             guhemama/http-precondition-bundle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. guhemama/http-precondition-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

guhemama/http-precondition-bundle
=================================

Introduces route preconditions when using the Symfony HttpKernel component.

2.0.0(2y ago)23.0k↑20%[2 issues](https://github.com/guhemama/http-precondition-bundle/issues)MITPHPPHP ^8.2

Since Dec 28Pushed 2y ago2 watchersCompare

[ Source](https://github.com/guhemama/http-precondition-bundle)[ Packagist](https://packagist.org/packages/guhemama/http-precondition-bundle)[ RSS](/packages/guhemama-http-precondition-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (4)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/25dfd41acea1e21c3a6679477bb00fcfc82dbd940a29dbb4ddd165c477309ae8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677568656d616d612f687474702d707265636f6e646974696f6e2d62756e646c65)](https://packagist.org/packages/guhemama/http-precondition-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/c5e69e95cbdf38dc9ae85ba5fcc7bff278a38e5ac518276ccfe00e2fd55561fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f677568656d616d612f687474702d707265636f6e646974696f6e2d62756e646c65)](https://packagist.org/packages/guhemama/http-precondition-bundle)

HTTP Precondition Bundle
========================

[](#http-precondition-bundle)

This bundle introduces a `Precondition` attribute that can be used to check for certain conditions when routing. When the conditions are not met, an exception is thrown (`412 Precondition failed`).

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

[](#installation)

Install the bundle with Composer:

```
$ composer require guhemama/http-precondition-bundle

```

Usage
-----

[](#usage)

To define a new precondition, import the `Guhemama\HttpPreconditionBundle\Annotations\Precondition`attribute and provide an expression `expr` to be evaluated - any valid ExpressionLanguage expression is accepted.

```
