A utility for defining and compiling nested validation rules within the Laravel framework. Use this to handle complex, dynamic validation logic for nested data structures.
// Source: https://github.com/laravel/framework | License: MIT | Copyright Taylor Otwell
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace Illuminate\Validation;
use Illuminate\Contracts\Validation\CompilableRules;
class NestedRules implements CompilableRules
{
/**
* The callback to execute.
*
* @var callable
*/
protected $callback;
/**
* Create a new nested rule instance.
*
* @param callable $callback
*/
public function __construct(callable $callback)
{
$this->callback = $callback;
}
/**
* Compile the callback into an array of rules.
*
* @param string $attribute
* @param mixed $value
* @param mixed $data
* @param mixed $context
* @ret
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key