<?php

    return [
        "type"           => "api",
        "model"          => App\Models\Api::class,
        "label"          => "APIs",
        "label_singular" => "API",
        "template"       => false,
        "hierarchic"     => false,
        "group"          => "products",
        "order"          => true,
        "showSlug"       => true,
        "showUri"        => false,

        "search" => [
            "title" => "block_title",
            "fields" => [
                "block_title",
            ],
            "relations" => [
                "rows",
            ],
        ],
        
        "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"          => "block_title",
                "label"         => "Frontend title",
                "type"          => "textBox",
                "maxLength"     => 150,
                "multiLanguage" => true,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation"    => "required|max:150",
                "inList"        => true,
                "search"        => true,
                "sort"          => true
            ],
            [
                "name"          => "rows",
                "label"         => "Text rows",
                "type"          => "multiplePicker",
                "longList"      => false,
                "allowInsert"   => true,
                "objectTypes"   => ["simpleRow"],
                "order"         => true
            ],
            [
                "name"          => "links",
                "label"         => "Links",
                "type"          => "multiplePicker",
                "longList"      => false,
                "allowInsert"   => true,
                "objectTypes"   => ["webLinks"],
                "order"         => false
            ],
            [
                "name"          => "authors",
                "label"         => "Authors",
                "type"          => "multiplePicker",
                "longList"      => false,
                "allowInsert"   => true,
                "objectTypes"   => ["simpleLinks"],
                "order"         => false
            ],
            [
                "name"          => "reference",
                "label"         => "Reference",
                "type"          => "link",
                "maxLabel"      => 150,
                "multiLanguage" => false,
                "objectTypes"   => [
                    "page", "product"
                ],
                "required"      => false,
            ],
            [
                "name"          => "platforms",
                "label"         => "Platforms",
                "type"          => "multiplePicker",
                "longList"      => false,
                "allowInsert"   => true,
                "objectTypes"   => ["platform"],
                "order"         => false
            ],
            [
                "name"          => "models",
                "label"         => "Models",
                "type"          => "multiplePicker",
                "longList"      => false,
                "allowInsert"   => true,
                "objectTypes"   => ["productGroup"],
                "order"         => false
            ],
            [
                "name"          => "image",
                "label"         => "Image",
                "type"          => "mediaPicker",
                "multiple"      => false,
                "mediaType"     => "image",
                "placement"     => "sidebar",
            ],
        ],
        "actions"        => [
            "insert", "edit", "delete", "order"
        ]
    ];
