Skip to content

Tag: eloquent

How do I create a eloquent Polymorphic relation

I have a two eloquent models model User and Retailer. I want to create a new model “Task” where there there should be a field “added_by” which can denote either a user or a retailer. How can I create the migration for Task so that there is a field that can denote either user or retaile…