<?php


return  
    [
        'model' => [
            'model' => \Litecms\Currency\Models\Currency::class,
            'table' => 'litecms_currency_currencies',
            'hidden'=> [],
            'visible' => [],
            'guarded' => ['*'],
            'slugs' => ['slug' => 'name'],
            'dates' => ['deleted_at', 'created_at', 'updated_at'],
            'appends' => [],
            'fillable' => ['user_id',  'country_id',  'country',  'name',  'symbol',  'exchange_rate',  'amount_format'],
            'translatables' => [],
            'upload_folder' => 'currency/currency',
            'uploads' => [
            /*
                    'images' => [
                        'count' => 10,
                        'type'  => 'image',
                    ],
                    'file' => [
                        'count' => 1,
                        'type'  => 'file',
                    ],
            */
            ],

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

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

        'search' => [
            
        ],

        'list' => [
            [
                "key" => "country_id", 
                "type" => "text", 
                "label" => 'currency::currency.label.country_id', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "country", 
                "type" => "text", 
                "label" => 'currency::currency.label.country', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "name", 
                "type" => "text", 
                "label" => 'currency::currency.label.name', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "symbol", 
                "type" => "text", 
                "label" => 'currency::currency.label.symbol', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "exchange_rate", 
                "type" => "text", 
                "label" => 'currency::currency.label.exchange_rate', 
                'sort' => true,
                'roles' => [],
            ],
            [
                "key" => "amount_format", 
                "type" => "text", 
                "label" => 'currency::currency.label.amount_format', 
                'sort' => true,
                'roles' => [],
            ],
        ],

        'form' => [
            [
                "key" => 'country_id',
                "element" => 'numeric',
                "type" => 'numeric',
                "label" => 'currency::currency.label.country_id',
                "placeholder" => 'currency::currency.placeholder.country_id',
                "rules" => '',
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

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

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

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

                ],
            ],
            [
                "key" => 'exchange_rate',
                "element" => 'decimal',
                "type" => 'decimal',
                "label" => 'currency::currency.label.exchange_rate',
                "placeholder" => 'currency::currency.placeholder.exchange_rate',
                "rules" => '',
                "group" => "main.main",
                "col" => "6",
                "append" => null,
                "prepend" => null,
                "roles" => [],
                "attributes" => [
                    'wrapper' => [],
                    "label" => [],
                    "element" => [],

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

                ],
            ],
        ],

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

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

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

        'controller' => [
            'provider' => 'Litecms',
            'package' => 'Currency',
            'module' => 'Currency',
        ],

        
         
        'actions' => [
            'copy' => [
                'type' => ['Details', 'List'],
                'label' => 'currency::currency.action.copy',
                'roles' => [
                    'user' => ['superuser', 'admin'],
                    'team' => ['admin'],
                    'permission' => ['currency.currency.copy', 'currency.currency.duplicate'],
                ],
                'form' => [
                    'count' => [
                        "element" => 'select',
                        "type" => 'select',
                        "label" => 'currency::currency.label.count',
                        "placeholder" => 'currency::currency.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" => 'currency::currency.label.comment',
                        "placeholder" => 'currency::currency.placeholder.comment',
                        "col" => "12",
                    ],
                ],
            ],
            'empty' => [
                'type' => ['List', 'Details'],
                'label' => 'currency::currency.action.empty',
                'roles' => [
                    'user' => ['superuser'],
                ],
            ],
            
            'section' => [
                'type' => ['Group'],
                'api_url' => '',
                'action' => 'list',
                'label' => 'currency::currency.action.section',
                'store' => 'main.units',
                'group' => 'main.units'
            ],

        ]
        
    ];