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

Model relations binding #21

Open
nesymno opened this issue Feb 7, 2018 · 4 comments
Open

Model relations binding #21

nesymno opened this issue Feb 7, 2018 · 4 comments

Comments

@nesymno
Copy link

nesymno commented Feb 7, 2018

Hey! How to bind model with relations? Like... I have post and have seo info for it. So, when I bind model, it works ok, but inputs with relations always null...
And validation errors don't show on relation inputs.

@vpratfr
Copy link
Member

vpratfr commented Feb 7, 2018

Can you give sample code?

@nesymno
Copy link
Author

nesymno commented Feb 8, 2018

{{ bs()->formGroup(bs()->text('seo[keywords]'))->label('Keywords')->addClass('col-12') }}

I'm opening form, bind model. All data good, except relations. I just add value by myself, but it would be great if relations will fill automatically.

@vpratfr
Copy link
Member

vpratfr commented Feb 8, 2018

Will have a look.

In the meantime, how about using the functions to set default values manually?

->default($post->seo->keywords)

@nesymno
Copy link
Author

nesymno commented Feb 11, 2018

@vpratfr yes of course.

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

No branches or pull requests

2 participants