FilamentF
Filament2y ago
Kyle

Get ID of parent model when making a child model using Relationship Manager via the modal

For example, when I am using a relationship manager to show the students inside a class. And the form editor for the class is currently showing the class edit form, and the students are shown in a table at the bottom of the page. There is a button in the table to create a new student, which will show a modal for creating the student.

Fortunately, the class_id is automatically set when saving the student model, but I need the class_id for a different purpose.

How do I get the parent class model (or at least its id property) so that I can use it in the dependency-injected functions?

Thank you very much in advance.
Was this page helpful?