Приклади частих конфігів.

Готова валідація відповідних форматів полів.

Copy->Paste

'status' => [
        'primary' => false,
        'migrations' => [
            'smallInteger:status|nullable|default:0',
        ],
        'datatable' => [
            'title' => 'Status',
            'data' => 'status',
        ],
        'exporttable' => 'status',
        'input' => [
            'type' => 'select',
            'label' => 'Status',
            'option_return' => 'array', // array / object
            'options' => [
                'config:const.status' => [
                    'key' => 'val',
                ],
            ],
        ],
    ],

'name' => [
        'primary' => true,
        'migrations' => [
            'string:name|nullable',
        ],
        'validations' => [
            'create' => 'required|string',
            'update' => 'required|string',
        ],
        'datatable' => [
            'title' => 'Title',
            'data' => 'name',
        ],
        'exporttable' => 'name',
        'input' => [
            'type' => 'text',
        ],
    ],

'created_by' => [
        'primary' => false,
        'migrations' => [
            'bigInteger:created_by|default:1|nullable',
        ],
        'datatable' => [
            'title' => 'Created By',
            'data' => 'creator.name',
        ],
        'exporttable' => 'created_by',
        'relationship' => [
            'creator' => 'belongsTo:App\User,created_by,id',
        ],
    ],

'updated_by' => [
        'primary' => false,
        'migrations' => [
            'bigInteger:updated_by|default:1|nullable',
        ],
        'exporttable' => 'updated_by',
        'relationship' => [
            'modifier' => 'belongsTo:App\User,updated_by,id',
        ],
    ],

'logo' => [
        'primary' => false,
        'migrations' => [
            'string:logo|nullable',
        ],
        'validations' => [
            'create' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
            'update' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
        ],
        'datatable' => [
            'title' => 'Logo',
            'data' => 'name',
        ],
        'exporttable' => 'logo',
        'input' => [
            'type' => 'file',
        ],
    ],

'images' => [
            'primary' => false,
            'validations' => [
                'create' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
                'update' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
            ],
            'input' => [
                'type' => 'file',
                'multiple' => true,
                'class'=>'load-img-library'
            ],
        ],

'teaser' => [
        'primary' => false,
        'migrations' => [
            'text:teaser|nullable',
        ],
        'validations' => [
            'create' => 'required',
            'update' => 'required',
        ],
        'datatable' => [],
        'exporttable' => 'teaser',
        'input' => [
            'type' => 'textarea',
        ],
    ],

'content' => [
        'primary' => false,
        'migrations' => [
            'text:content|nullable',
        ],
        'validations' => [],
        'datatable' => [],
        'exporttable' => 'content',
        'input' => [
            'type' => 'textarea',
            'label' => 'Content',

        ],
    ],

'slug' => [
        'primary' => false,
        'migrations' => [
            'text:slug|nullable|string',
        ],
        'validations' => [],
        'datatable' => [],
        'exporttable' => 'slug',

    ],

'email' => [
            'primary' => false,
            'migrations' => [
                'string:email|nullable',
            ],
            'validations' => [
                'create' => 'required|email:rfc,dns',
                'update' => 'required|email:rfc,dns',
            ],
            'datatable' => [
                'title' => 'Email',
                'data' => 'email',
            ],
            'exporttable' => 'email',
            'input' => [
                'type' => 'email',
            ],
        ],

'last_name' => [
            'primary' => false,
            'migrations' => [
                'string:last_name|nullable',
            ],
            'validations' => [
                'create' => 'string',
                'update' => 'string',
            ],
            'datatable' => [
                'title' => 'Last Name',
                'data' => 'last_name',
            ],
            'exporttable' => 'last_name',
            'input' => [
                'type' => 'text',
            ],
        ],