<?php


return  
    [
        'model' => [
            'model' => \Eform\Instruction\Models\InstructionCategory::class,
            'table' => 'eform_instruction_instruction_categories',
            'hidden'=> [],
            'visible' => [],
            'guarded' => ['*'],
            'slugs' => ['slug' => 'name'],
            'dates' => ['deleted_at', 'created_at', 'updated_at'],
            'appends' => [],
            'fillable' => ['name',  'description',  'image',  'user_id',  'status'],
            'translatables' => [],
            'upload_folder' => 'instruction/instruction_category',
            'uploads' => [
            /*
                    'images' => [
                        'count' => 10,
                        'type'  => 'image',
                    ],
                    'file' => [
                        'count' => 1,
                        'type'  => 'file',
                    ],
            */
            ],

            'casts' => [
            
            /*
                'images'    => 'array',
                'file'      => 'array',
            */
            ],

            'revision' => [],
            'perPage' => '20',
            'search'        => [
                'name'  => 'like',
                'status',
            ]
        ],

        'search' => [
            "name" => [
                "key" => "name", 
                "col" => 4, 
                "operators" => ['LIKE', '=', 'IN', 'BETWEEN'], 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.name', 
                "placeholder" => 'instruction::instruction_category.placeholder.name', 
            ],
            "user_id" => [
                "key" => "user_id", 
                "col" => 4, 
                "operators" => ['LIKE', '=', 'IN', 'BETWEEN'], 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.user_id', 
                "placeholder" => 'instruction::instruction_category.placeholder.user_id', 
            ],
            "status" => [
                "key" => "status", 
                "col" => 4, 
                "operators" => ['LIKE', '=', 'IN', 'BETWEEN'], 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.status', 
                "placeholder" => 'instruction::instruction_category.placeholder.status', 
            ],
        ],

        'list' => [
            [
                "key" => "name", 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.name', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "description", 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.description', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "user_id", 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.user_id', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "status", 
                "type" => "text", 
                "label" => 'instruction::instruction_category.label.status', 
                'sort' => true,
                'roles' => [],
            ],
        ],

        'form' => [
            [
                "key" => 'name',
                "element" => 'text',
                "type" => 'text',
                "label" => 'instruction::instruction_category.label.name',
                "placeholder" => 'instruction::instruction_category.placeholder.name',
                "required" => 'true',
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

                ],
            ],
            [
                "key" => 'description',
                "element" => 'text',
                "type" => 'text',
                "label" => 'instruction::instruction_category.label.description',
                "placeholder" => 'instruction::instruction_category.placeholder.description',
                "required" => 'true',
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

                ],
            ],
            [
                "key" => 'image',
                "element" => 'text',
                "type" => 'text',
                "label" => 'instruction::instruction_category.label.image',
                "placeholder" => 'instruction::instruction_category.placeholder.image',
                "rules" => '',
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

                ],
            ],
            [
                "key" => 'status',
                "element" => 'select',
                "type" => 'select',
                "label" => 'instruction::instruction_category.label.status',
                "placeholder" => 'instruction::instruction_category.placeholder.status',
                "required" => 'true',
                "options" => function(){
                    return trans('instruction::instruction_category.options.status');
                },
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

                ],
            ],
        ],

        'urls' => [
            'new' => [
                'url' => 'instruction/instruction_category/new',
                'method' => 'GET',
            ],
            'create' => [
                'url' => 'instruction/instruction_category/create',
                'method' => 'GET',
            ],
            'store' => [
                'url' => 'instruction/instruction_category',
                'method' => 'POST',
            ],
            'update' => [
                'url' => 'instruction/instruction_category',
                'method' => 'PUT',
            ],
            'list' => [
                'url' => 'instruction/instruction_category',
                'method' => 'GET',
            ],
            'delete' => [
                'url' => 'instruction/instruction_category',
                'method' => 'DELETE',
            ],
        ],

        'order' => [
            'created_at' => 'instruction::instruction_category.label.created_at',
            'name' => 'instruction::instruction_category.label.name',
            'status' => 'instruction::instruction_category.label.status',
        ],

        'groups' => [
            [
                'icon' => "mdi:account-supervisor-outline",
                'name' => "instruction::instruction_category.groups.main",
                'group' => "main.main",
                'title' => "instruction::instruction_category.groups.main",
            ],
            [
                'icon' => "fe:home",
                'name' => "instruction::instruction_category.groups.details",
                'group' => "main.details",
                'title' => "instruction::instruction_category.groups.details",
            ],
            'images' => [
                'icon' => "fe:home",
                'name' => "instruction::instruction_category.groups.images",
                'group' => "main.images",
                'title' => "instruction::instruction_category.groups.images",
            ],
            'settings' => [
                'icon' => "fe:home",
                'name' => "instruction::instruction_category.groups.settings",
                'group' => "main.settings",
                'title' => "instruction::instruction_category.groups.settings",
            ]
        ],

        'controller' => [
            'provider' => 'Eform',
            'package' => 'Instruction',
            'module' => 'InstructionCategory',
        ],

        
         
        'actions' => [
            'copy' => [
                'type' => ['Details', 'List'],
                'label' => 'instruction::instruction_category.action.copy',
                'roles' => [
                    'user' => ['superuser', 'admin'],
                    'team' => ['admin'],
                    'permission' => ['instruction.instruction_category.copy', 'instruction.instruction_category.duplicate'],
                ],
                'form' => [
                    'count' => [
                        "element" => 'select',
                        "type" => 'select',
                        "label" => 'instruction::instruction_category.label.count',
                        "placeholder" => 'instruction::instruction_category.placeholder.count',
                        "options" => call_user_func(function () {
                            return [
                                1 => ['value' => 1, 'text' => 1],
                                2 => ['value' => 2, 'text' => 2],
                                3 => ['value' => 3, 'text' => 3],
                                4 => ['value' => 4, 'text' => 4],
                            ];
                        }),
                        "col" => "12",
                    ],
                    'comment' => [
                        "element" => 'textarea',
                        "type" => 'text',
                        "required" => 'required',
                        "label" => 'instruction::instruction_category.label.comment',
                        "placeholder" => 'instruction::instruction_category.placeholder.comment',
                        "col" => "12",
                    ],
                ],
            ],
            'empty' => [
                'type' => ['List', 'Details'],
                'label' => 'instruction::instruction_category.action.empty',
                'roles' => [
                    'user' => ['superuser'],
                ],
            ],
            
            'section' => [
                'type' => ['Group'],
                'api_url' => '',
                'action' => 'list',
                'label' => 'instruction::instruction_category.action.section',
                'store' => 'main.units',
                'group' => 'main.units'
            ],

        ]
        
    ];