Replies: 1 comment 2 replies
-
try using ->pluck() |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Actions
Package Version
v3.2.124
How can we help you?
I have Post and Note models (and Filament resources).
And I have a Filament relation manager set up for the Post resource, to show a list of associated Notes.
The Post model uses a string key instead of a numeric ID.
The Note resource has a form, with fields for (Post) key and summary.
I reuse the form for both the Note resource and the Post resource (through ViewPost.php).
So: I can create a new Note (and select the associated Post), or I can select a Post and add a new Note (for that Post).
Everything works as expected when using a fixed list of options for the key Select field in the form.
But when using
->relationship('post', 'key')
in the form it works in the resource, but not when using it through action inViewPost.php
.The error when pressing 'addNote' headerAction button:
The error is shown before the modal is shown.
Any suggestions how to make the Post relationship lookup work in both scenario's?
The code snippets:
The form, which fails for option A (when called through
ViewPost.php
) and always works for option B.Beta Was this translation helpful? Give feedback.
All reactions