Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dot" syntax in names #51

Open
mkswebdev opened this issue Jan 18, 2019 · 1 comment
Open

"dot" syntax in names #51

mkswebdev opened this issue Jan 18, 2019 · 1 comment

Comments

@mkswebdev
Copy link

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?

@netojose
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants