title: Laravel ORM User can favorite Multiple Models
body: <p>I am trying to find out the best way to define the following relation using Laravel's Eloquent Laravel.</p>
  
  <p>I have a User table and 3 Objects ( Player, Team, League) that the user can add as favorites.</p>
  
  <p>I know I can create three pivot tables with the User Model and each one of the objects but then I will need to run a Union query to list all favorites from user regardless of type.</p>
  
  <pre><code>User
   id
  
  Favorite
   id
   user_id
   favorited_id  ( player_id or team_id or league id)
   favorite_type  ( player , team or league) 
  
  Player
   id  
  
  Team
   id
  
  League
   id
  </code></pre>
  
  <p>Here is my model.</p>
  
  <p><a href="https://www.dropbox.com/s/6au8giufaejcghc/Screen%20Shot%202014-04-07%20at%209.06.51%20AM.png" rel="nofollow">https://www.dropbox.com/s/6au8giufaejcghc/Screen%20Shot%202014-04-07%20at%209.06.51%20AM.png</a></p>