laravel-bootstrap-4-forms
laravel-bootstrap-4-forms copied to clipboard
"dot" syntax in names
netojose/laravel-bootstrap-4-forms 2.0.6
I use dimsav/laravel-translatable.
Form fields:
{!! Form::text('ru[title]', 'Title RU', $presentation->translateOrNew('ru')->title) !!}
{!! Form::text('en[title]', 'Title EN', $presentation->translateOrNew('en')->title) !!}
...
Validation rules:
public function rules()
{
return [
'ru.title' => 'required|string|max:255',
'en.title' => 'string|max:255',
...
];
}
If errors occur, data is returned to form with rules names, "dot" syntax is used. ru.title != ru[title] and field ru[title] reset value and does not show an error.
Is there any solution for this problem?
Good question, @mkswebdev , I'm working on a new version, and your problem sounds interesting, on work with "array fields". I will think about this