PHPackages                             fluoresce/validate-embedded - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. fluoresce/validate-embedded

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

fluoresce/validate-embedded
===========================

Constraint enabling group-based validation of embedded objects with the Symfony Validator Component.

1.3.0(2y ago)7137.4k↓41.7%1MITPHPPHP &gt;=5.5.9

Since Apr 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fluoresceco/validate-embedded)[ Packagist](https://packagist.org/packages/fluoresce/validate-embedded)[ Docs](https://github.com/fluoresceco/validate-embedded)[ RSS](/packages/fluoresce-validate-embedded/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Validate Embedded
=================

[](#validate-embedded)

This library provides the `Validate` constraint for the [Symfony Validator Component](https://github.com/symfony/validator).

This constraint behaves similar to the built-in `Valid` constraint, but respects the `groups` option. Additionally, it adds an option to specify the validation groups to target on the embedded object(s).

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

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require fluoresce/validate-embedded
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

Documentation
-------------

[](#documentation)

*The following examples assume you are using the full Symfony framework, though this package can be used in any project that has the Symfony Validator Component available*

### Basic Usage

[](#basic-usage)

This example shows an `Author` which has a collection of `Book`s. When validation is run for `group1` on `Author`, it will cascade to all embedded `Book` instances.

The behaviour here is slightly different to the standard `Valid` constraint, as validation of the `Book` instances is run with the default group.

```
