<?php

use App\Models\CardCompetitionItem;

return [
    "type"           => "card_competition_item",
    "model"          => CardCompetitionItem::class,
    "label"          => "content_types.card_competition_item_plural",
    "label_singular" => "content_types.card_competition_item_singular",
    "group"          => "content",
    "order"          => TRUE,
    "search" => [
        "fields" => [
            "title",
            "content",
        ],
        "parentRelationships" => [
        ]
    ],
    "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"          => "tag",
            "label"         => "Tag",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:150",
        ],
        [
            "name"          => "image_caption",
            "label"         => "Image Caption",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:150",
        ],
        [
            "name"          => "subtitle",
            "label"         => "Subtitle",
            "type"          => "textBox",
            "maxLength"     => 150,
            "multiLanguage" => TRUE,
            "preValidation" => "strip_tags|xss_clean|trim",
            "validation"    => "nullable|max:150",
        ],
        [
            "name"          => "content",
            "label"         => "Content",
            "type"          => "editor",
            'multiLanguage' => TRUE,
            'preValidation' => 'strip_tags|xss_clean|trim',
            'validation'    => "nullable",
        ],
        [
            "name"          => "link",
            "label"         => "Link",
            "type"          => "link",
            "objectTypes"   => ["article", "event", "page", "competition", "result"],
            "required"      => false,
        ],
        [
            "name"          => "image",
            "label"         => "Image",
            "type"          => "mediaPicker",
            "multiple"      => FALSE,
            "mediaType"     => "image",
        ],
    ],
    "actions"        => [
        "edit", "insert", "delete"
    ]
];
