i need to save a relation between two products or batches (an exchange or swap) but both id's on the table could be a product or a batch so i need both id's to be polymorphic
@diegopr83 , i don't think there is a way of doing that using eloquent built in polymorphics relations, because it's defined by just two fields, id and type.
You have two options:
Create your custom polymorphic relation class, then you would have to handle all the details of Insert, Update, Find,etc
Since Teams and National Teams are both teams, you could create a master table for teams, and then two tables(table 1 and table 2) that references that master table. It's like inheritance but in the database model. In that way you would have just one ID that you can use the find method, and also a type field that you will use to get the proper relation
@vilfago yes, i kinda like it, i think it gives your app some flexibility and you don't have to manage tons of tables, all you need to do is specify the model it belongs. It may causes perfomance issues, since you're not really creating a foreign key, thus a index that could speed up queries, but for the most apps nowadays, this is not a problem. But in this case, the built in polymorphics relation won't work, so yeah, solution 2 might be more appropriate