Laravel, many-to-many relationship to multiple models
<p>Looking for a simple way of doing the following in Laravel 5.</p>

<p>Imagine these models and interface</p>

<ul>
<li>Competition</li>
<li>User</li>
<li>Team</li>
<li>Participant (Interface which User and Team implements)</li>
</ul>

<p>A competition will have a many-to-many relationship to is participants, which can be either users or teams. So I need the competition_participant pivot table to have the following columns to define the models</p>

<ul>
<li>competition_id</li>
<li>participant_id</li>
<li>participant_type</li>
</ul>

<p>But how do I write a relation on the Competition model, so it knows which model it should fetch from the database, and at the same time return a collection of mixed models or of the Interface type?</p>