adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Should support Laravel 5.2 new array validation #82

Open simplenotezy opened 8 years ago

simplenotezy commented 8 years ago

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]') !!}
adamwathan commented 8 years ago

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