Polymorphic relationships are used when there may be multiple models related to one particular model, with the potential to have even more models in the future.
For example, Tags may be related to Articles, or to Photos, or maybe in the future to Users, or to Comments, etc. So, to avoid changing the database structure for those new models, you define a Polymorphic relationship, and re-use it for all current/future models, just by changing the Model classes code, but not the database itself.
Read more in the official Laravel docs.
For example, Tags may be related to Articles, or to Photos, or maybe in the future to Users, or to Comments, etc. So, to avoid changing the database structure for those new models, you define a Polymorphic relationship, and re-use it for all current/future models, just by changing the Model classes code, but not the database itself.
Read more in the official Laravel docs.