<?php

    return [
        "type"           => "pack",
        "model"          => App\Models\Pack::class,
        "label"          => "All Options",
        "label_singular" => "Option",
        "group"          => "options",
        "order"          => FALSE,
        "fields"         => [
            [
                "name"          => "title",
                "label"         => "Title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
                "name"          => "content_title",
                "label"         => "Pack Name",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => TRUE,
                "search"        => TRUE,
                "sort"          => TRUE
            ],
            [
              "name"          => "content",
              "label"         => "Content / Features",
              "type"          => "editor",
              "multiLanguage" => TRUE,
              "preValidation" => "xss_clean|trim",
              "validation"    => ""
            ],
            [
                "name"          => "description",
                "label"         => "Info Modal Description",
                "type"          => "editor",
                "multiLanguage" => TRUE,
                "preValidation" => "xss_clean|trim",
                "validation"    => ""
            ],
            [
                "name"          => "icon",
                "label"         => "Image Icon",
                "info"          => "SVG",
                "type"          => "mediaPicker",
                "multiple"      => false,
                "multiLanguage" => false,
                "mediaType"     => "document",
                "allowed"       => "svg",
                "placement"     => "sidebar",
            ],
            [
                "name"          => "price",
                "label"         => "Price",
                "type"          => "textBox",
                "maxLength"     => 8,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|numeric",
                "inList"        => TRUE,
                "search"        => FALSE,
                "sort"          => TRUE,
                "placement"     => "sidebar"
            ],
            [
                "name"        => "promo_active",
                "label"       => "Promotion",
                "type"        => "selectBox",
                "list" => array(
                    "0" => "No Promotion",
                    "1" => "Promo Active"
                ),
                "placement" => "sidebar",
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|in:0,1",
                "inList"        => TRUE
            ],
            [
                "name"          => "promo_price",
                "label"         => "Promotional Price",
                "type"          => "textBox",
                "maxLength"     => 8,
                "multiLanguage" => FALSE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "nullable|numeric",
                "placement"     => "sidebar",
                "nullable"      => TRUE,
                "parent"      => [
                    "name"   => "promo_active",
                    "values" => [ "1" ]
                ]
            ],
            [
                "name"          => "promo_text",
                "label"         => "Promo headline",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => TRUE,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required_if:promo_active,1|max:150",
                "placement"     => "sidebar",
                "parent"      => [
                    "name"   => "promo_active",
                    "values" => [ "1" ]
                ]
            ],
            [
                "name"        => "simpleContents",
                "label"       => "Detail Tabs",
                "type"        => "multiplePicker",
                "longList"    => TRUE,
                "allowInsert" => TRUE,
                "objectTypes" => ["simple_content"],
                "order"       => TRUE,
                "maxSize"     => 10
            ],
        ],
        "actions"        => [
            "edit", "order", "insert", "delete"
        ]
    ];
