# fluent-support/1.10.2/app/Http/Requests/ProductRequest.php

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version 1.10.2. 40 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/1.10.2/code/app/Http/Requests/ProductRequest.php
- Raw: https://pluginprobe.com/plugins/fluent-support/1.10.2/raw/app/Http/Requests/ProductRequest.php
- Modified: 2022-08-24T14:31:58+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-support/1.10.2/code/app/Http/Requests/ProductRequest.php#L10-L20`.

```php
<?php

namespace FluentSupport\App\Http\Requests;

use FluentSupport\Framework\Foundation\RequestGuard;
use FluentSupport\Framework\Support\Arr;

class ProductRequest extends RequestGuard
{
    /**
     * @return Array
     */
    public function rules()
    {
        return [
            'title' => 'required'
        ];
    }

    /**
     * @return Array
     */
    public function messages()
    {
        return [
            'title.required' => 'Product Title is required'
        ];
    }

    public function sanitize()
    {
        $data = $this->all();

        $data['title'] = sanitize_text_field($data['title']);
        $data['description'] = sanitize_textarea_field(Arr::get($data, 'description'));

        return $data;
    }
}

```
