laravel-bootstrap-4-forms icon indicating copy to clipboard operation
laravel-bootstrap-4-forms copied to clipboard

"dot" syntax in names

Open mkswebdev opened this issue 6 years ago • 1 comments

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?

mkswebdev avatar Jan 18 '19 04:01 mkswebdev

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

netojose avatar Feb 24 '19 17:02 netojose