bootforms icon indicating copy to clipboard operation
bootforms copied to clipboard

Should support Laravel 5.2 new array validation

Open simplenotezy opened this issue 9 years ago • 1 comments

Hello! This package should defiantly support the new Laravel 5.2 array validation. Like this:

/**
 * Get the validation rules that apply to the request.
 *
 * @return array
 */
public function rules()
{
    return [
        'name' => 'min:3',
        'slug' => 'min:2',
        'description' => '',
        'coveriamge' => 'image',
        'start' => 'required|date_format:Y-m-d H:i:s',

        'tickettype.*.tickettype_id' => 'exists:ticket_types,id',
        'tickettype.*.name' => 'min:3|max:50',
        'tickettype.*.description' => 'max:255',
        'tickettype.*.price' => 'integer|between:1,5000',
        'tickettype.*.currency' => 'required|exists:currencies,code',
        'tickettype.*.only_members' => 'integer',
        'tickettype.*.quantity' => '',
        'tickettype.*.required_subscriptions' => '',

    ];
}

And:

{!! BootForm::text('Name', 'tickettype[][name]') !!}

simplenotezy avatar Dec 25 '15 18:12 simplenotezy

Yeah great idea, will try and play with it in the near future, but happy to look at PRs in the meantime.

adamwathan avatar Jan 04 '16 12:01 adamwathan