title: User watchlist design improvements with Laravel and Eloquent
body: <p>I'd like to implement a kind of watchlist per user on my application. The watchlist can hold different types of objects, each of those objects being a model in the database.</p>
  
  <p>Here's a quick overview of the db schema I've yet implemented.</p>
  
  <p><img src="https://i.stack.imgur.com/RuVan.png" alt="enter image description here"></p>
  
  <p>Most of the time I'll be needing to retrieve only specific items (like a Label, or an Artist) from that watchlist. This is how I got it working right now :</p>
  
  <pre><code> // controller
   $watchedLabels = User::find(4)-&gt;labelsWatchlist();
  
   // user model
  public function labelsWatchlist()
  {
      $object_type = WatchlistObject::where('name', '=', 'label')-&gt;first();
  
      if ($watchlistObject) {
          return DB::table('users_watchlists')
                  -&gt;join('artists', 'users_watchlists.object_id', '=', 'artists.id')
                  -&gt;where('users_watchlists.user_id', '=', $this-&gt;id)
                  -&gt;where('users_watchlists.object_type_id', '=', $object_type-&gt;id)
                  -&gt;get();
      }
  }
  </code></pre>
  
  <p>So as I said, this works perfectly... But for some reason that I can't explain, I don't really like that implementation, finding it a bit lame. I'd like to be able to get the same results in a, let's say "more fluid" manner, something like $user->watchlist->labels. But this isn't really possible with the current setup...</p>
  
  <p>Any suggestions ?!</p>