<?php

return [
    "type"           => "state",
    "model"          => App\Models\State::class,
    "label"          => "content_types.state_plural",
    "label_singular" => "content_types.state_singular",
    "group"          => "general",
    "search"         => [
        "title" => "title",
        "fields" => [
            "title",
            "common_name",
        ],
        "relations" => [
        ],
    ],
    "fields"         => [
        [
            "name"          => "title",
            "label"         => "Name",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:150",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "code",
            "label"         => "Code (ISO 3166-2)",
            "type"          => "textBox",
            "maxLength"     => 10,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "required|max:10",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "country_id",
            "label"         => "Country",
            "type"          => "selectBox",
            "contentType"   => "country",
            "mandatory"     => TRUE,
            "preValidation" => "trim",
            "inList"        => TRUE,
            "search"        => TRUE,
            "sort"          => TRUE
        ],
        [
            "name"          => "nuts_code",
            "label"         => "NUTS Code",
            "type"          => "textBox",
            "maxLength"     => 4,
            "multiLanguage" => FALSE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:4"
        ],
    ],
    "actions"        => [
        "insert", "edit", "delete"
    ]
];
