Hi,
based on my earlier question (https://laracasts.com/discuss/channels/eloquent/l52-pivot-table-with-additional-fields-dates), I now have a similar problem:
I have the following models:
-
Employee
-
SchoolGraduation
-
UniversityGraduation
-
SecondEducation
- and some other 'graduation'-type models.
Each Employee can have multiple Certificates which basically are the above listet types. So I think, a polymorphic relation is what I want to use here (right?).
But, I also need to add some additional information to the pivot, like a completion field and a comment field.
Basically, the above listed 'graduation'-type models are simple objects with a name and a description field. And a given Employee can have several of them, with the extra information of when they get it and an optional comment (thus, I want to have the above mentioned extra fields on the pivot).
First of all, does it make sense? Or do I miss/oversee something?!
If my thoughts are right so far, is it possible to use something like this with polymorphic relations? If so, would this be a regular polymorphic relation or a many-to-many polymorphic relation? And how do I use a custom pivot on this polymorphic relation?
Thanks in advance for any tips :)