lorenzoberti
1 year ago
3307
8
Nova

Use ONE form for 2 resources

Posted 1 year ago by lorenzoberti

I'm new on Laravel Nova. I'm trying to build a User form. In this moment I have these models: User, UserDetail

In User I have: email, password, username. In UserDetail I have: Name, Lastname, Gender, Number, etc.

Now I would create ONE form for user. Why I'm focusing on ONE? Because in my User Resource fields I have:

HasOne::make("UserDetail", "details")

But For set user detail I have 2 form: One for User data (username, password, email) And after save the user I can set detail.

So I don't want compile 2 different form for 1 resource.

I have found this package, but seems broke:

https://github.com/yassipad/laravel-nova-nested-form/issues/66

And the fields UserDetails doens't shown.

So is there any other way for add text field from relationship and merge in same Form?

Please sign in or create an account to participate in this conversation.