# fluent-cart/1.6.4/app/Http/Requests/ProductDownloadable/ProductDownloadableFileRequest.php

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

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Http/Requests/ProductDownloadable/ProductDownloadableFileRequest.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Http/Requests/ProductDownloadable/ProductDownloadableFileRequest.php
- Modified: 2026-01-20T13:25:38+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/app/Http/Requests/ProductDownloadable/ProductDownloadableFileRequest.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Http\Requests\ProductDownloadable;

use FluentCart\Framework\Foundation\RequestGuard;

class ProductDownloadableFileRequest extends RequestGuard
{

    /**
     * @return array
     */
    public function rules()
    {

        return [
            //'product_variation_id' => 'required|array|min:1',
            'title' => 'required|sanitizeText|maxLength:100',
            'type' => 'required|sanitizeText|maxLength:100',
            'driver' => 'required|sanitizeText|maxLength:100',
            'file_name' => 'required|sanitizeText|maxLength:100',
            'settings.download_limit' => 'nullable|numeric',
            'settings.download_expiry' => 'nullable|numeric',
        ];
    }


    /**
     * @return array
     */
    public function messages(): array
    {
        return [
            'title.required' => esc_html__('Title is required.', 'fluent-cart'),
            'type.required' => esc_html__('Type is required.', 'fluent-cart'),
            'driver.required' => esc_html__('Driver is required.', 'fluent-cart'),
            'file_name.required' => esc_html__('File Name is required.', 'fluent-cart'),
            'file_path.required' => esc_html__('File Path is required.', 'fluent-cart'),
            'file_url.required' => esc_html__('File URL is required.', 'fluent-cart'),
        ];
    }


    /**
     * @return array
     */
    public function sanitize()
    {

        return [
            'id' => 'intval',
            //'post_id' => 'intval',
            'product_variation_id' => function ($value) {
                if (!is_array($value)) {
                    return [];
                }
                return array_values(array_filter(array_map(function ($id) {
                    return sanitize_text_field($id);
                }, $value)));
            },
            //'download_identifier' => 'sanitize_text_field',
            'title' => 'sanitize_text_field',
            'type' => 'sanitize_text_field',
            'driver' => 'sanitize_text_field',
            'file_name' => 'sanitize_text_field',
            'file_path' => 'sanitize_text_field',
            'file_url' => 'sanitize_text_field',
            'settings' => function ($value) {
                return $value;
            },
            'serial' => 'intval',
            //'created_at' => 'sanitize_text_field',
            //'updated_at' => 'sanitize_text_field',
        ];

    }
}

```
