Closed magdicom closed 1 year ago
This PR has been reverted, please add HasMany
field to fieldsForCreate()
or fields()
if you need to use this structure.
@crynobone what you say actually is that I'm forced to use fields()
at all cases and I cannot specify fields in different methods like fieldsForDetails
and fieldsForIndex
!
I would recommend using fields()
and only uses dynamic fields for further customisation. Internally for relations checking we would prefer to filters all dynamic fields to avoid false positive and avoid performance penalty when we need to check if the field actually exists in a resource.
I see your point, but I wish you would reconsider this even later.
also if this can be mentioned in the docs it would be very time savior.
Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description:
I'm using
Resource::fieldsForDetail
to display certain fields different from what is displayed in index and update resource form. when defining the relationship fieldHasMany
inside theResource::fieldsForDetail
method the table will load normally, but the problem is when I click theCreate XX
button above this relationship table it will keeps loading and it will return a 404 error page at the logs.The fix: after hours of tweaking this I figured it could only work if the same relationship field is defined in the
fields
method, even if its hidden.Detailed steps to reproduce the issue on a fresh Nova installation:
to reproduce this error you simply need to define a
HasMany
field in one resources'fieldsForDetail
:the example above wont work when you try to create a new post from inside user details page.