# fluent-cart/1.3.19/app/Http/Requests/TaxClassRequest.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.3.19. 46 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.3.19/code/app/Http/Requests/TaxClassRequest.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.3.19/raw/app/Http/Requests/TaxClassRequest.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.3.19/code/app/Http/Requests/TaxClassRequest.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Http\Requests;

use FluentCart\App\Models\TaxClass;
use FluentCart\Framework\Foundation\RequestGuard;
use FluentCart\Framework\Support\Arr;

class TaxClassRequest extends RequestGuard
{

    public function rules()
    {
        $classId = intval(Arr::get($this->all(), 'id', 0));

        return [
            'title'       => 'required|sanitizeText|maxLength:192',
            'description' => 'nullable|sanitizeTextArea',
            'categories'  => 'nullable|array',
        ];
    }

    public function messages()
    {
        return [
            'title.required' => esc_html__('Tax class title is required.', 'fluent-cart'),
        ];
    }

    public function sanitize()
    {
        return [
            'title'       => 'sanitize_text_field',
            'description' => 'sanitize_text_field',
            'priority'    => 'intval',
            'categories'  => function ($value) {
                if (is_array($value)) {
                    return array_map('intval', $value);
                }
                return $value;
            }
        ];
    }

}

```
