# fluent-cart/1.6.4/api/Validator/Validation.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 22 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/api/Validator/Validation.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/api/Validator/Validation.php
- Modified: 2025-10-14T16:36:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/api/Validator/Validation.php#L10-L20`.

```php
<?php

namespace FluentCart\Api\Validator;

use FluentCart\Framework\Response\Response;
use FluentCart\Framework\Validator\Validator;

abstract class Validation
{
    public static function validate($data, $rules = [])
    {
        $validator = (new Validator())->make($data, empty($rules) ? static::rules() : $rules);

        if($validator->validate()->fails()) {
            $response = new Response();
            return $response->json(['errors' => $validator->errors()], 403);
        }

        return false;
    }
}

```
