laravel-nova-nested-form icon indicating copy to clipboard operation
laravel-nova-nested-form copied to clipboard

Doesn't show Nested Form

Open SmbatPoghosyan opened this issue 5 years ago • 16 comments

Laravel 5.8 Nova 2.0.9

App/WebsiteTwilioNumber public function website() { return $this->belongsTo('App\Website'); } }

App/Website public function websiteTwilioNumbers() { return $this->hasMany('App\WebsiteTwilioNumber'); }

Nova/Website

 public function fields(Request $request)
    {
        return [
            ...
            HasMany::make('WebsiteTwilioNumbers'),
            NestedForm::make('WebsiteTwilioNumbers'),
        ];
    }

HasMany work good NestedForm doesn't work

SmbatPoghosyan avatar Jul 04 '19 14:07 SmbatPoghosyan

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

4n70w4 avatar Jul 09 '19 14:07 4n70w4

+1

gdespirito avatar Jul 21 '19 19:07 gdespirito

+1 the same here laravel : 5.8.* nova : 2.0.8

atmonshi avatar Jul 22 '19 19:07 atmonshi

+1 Same here!

loreberti89 avatar Jul 26 '19 10:07 loreberti89

The problem of Visibility is solved with add: 'panel'=>$this->panel,

to jsonSerialize() function in Yassi\NestedForm\NestedForm class.

But now, for me return a error in SQL:

General error: 1364 Field 'user_id' doesn't have a default value (SQL: insert into user_details (name, updated_at, created_at) values (Lorenzo, 2019-07-29 10:01:04, 2019-07-29 10:01:04))",

In my User Nova Resource FIELDS I have:

NestedForm::make("Details", 'details', UserDetail::class)->open(true),

loreberti89 avatar Jul 29 '19 10:07 loreberti89

so, this is just not going to be fixed?

g0shed avatar Jul 31 '19 08:07 g0shed

@loreberti89 that fixes it actually

g0shed avatar Jul 31 '19 17:07 g0shed

If you try to save the resource with the related model/resources, it works?

loreberti89 avatar Jul 31 '19 19:07 loreberti89

+1

spintokha avatar Jul 31 '19 20:07 spintokha

@loreberti89 yup

g0shed avatar Jul 31 '19 21:07 g0shed

@loreberti89 yup

For me, with HasOne relationships doesn't work.

loreberti89 avatar Aug 01 '19 06:08 loreberti89

@loreberti89 from what I can see on your log, user_id is missing, it might be related to something else, with a hasMany relation it actually works perfectly

thanks for your find tho

g0shed avatar Aug 06 '19 10:08 g0shed

@g0shed hey man, i wonder if we upgraded to laravel nova 2 why in the composer is still ^1.something, am i mistaken on how this carret works? shouldn't we need to bump it

BobbyBorisov avatar Aug 08 '19 06:08 BobbyBorisov

@loreberti89 I am trying to use this package with hasOne relationship and somehow when i edit the resource it tries to create new nested entity instead of updating the old one and it says 'duplicate id = .. ' is there any fix for that issue? are you experience the same thing?

BobbyBorisov avatar Aug 08 '19 11:08 BobbyBorisov

@loreberti89 I am trying to use this package with hasOne relationship and somehow when i edit the resource it tries to create new nested entity instead of updating the old one and it says 'duplicate id = .. ' is there any fix for that issue? are you experience the same thing?

No, sorry. I've solved the problem related to show, but when I see that there are more and many bug and that it is no longer mantained, I leave this package.

loreberti89 avatar Aug 09 '19 07:08 loreberti89

@loreberti89 i think i solved the issue related to hasOne. but I am on Nova 2.0.5. and so far don't have any other issues. what are you gonna use instead?

BobbyBorisov avatar Aug 09 '19 07:08 BobbyBorisov