Skip to content

Passing attributes as an array

Compare
Choose a tag to compare
@tabuna tabuna released this 09 Jul 06:24
· 5070 commits to master since this release

I think it's worth supporting both types of entries, since the line view does not allow the declaration of lists (associative), tables or functions of closures

Current view:

/**
* @return array
*/
public function fields() : array
{
    return [
        'body'        => 'tag:wysiwyg|name:body|max:255|required|rows:10',
    ];
}

Array type:

/**
* @return array
*/
public function fields() : array
{
    return [
        'body' => [
            'tag'      => 'wysiwyg',
            'name'     => 'body',
            'max'      => 255,
            'required' => true,
            'rows'     => 10,
        ],
    ];
}