Effective usage of multiple joins in Eloquent dependent on variable
I don't see a way to do it with eager loads. I wonder if you could reduce it to getBy($k, $v) using distinct though?

class Movie extends Eloquent
{

    function writers()
    {
        return $this-&gt;belongsToMany('Writer');
    }

    function actors()
    {
        return $this-&gt;belongsToMany('Actor');
    }

    /**
     * Get a list of Movies with the matching the key-value.
     * 
     * @param string $k Key (movie attribute) name
     * @param string $v Value of the movie attribute
     *
     * @return \Illuminate\Database\Query\Builder
     */
    function getBy($k, $v) {
        return Movie::join('movie_writers as mw', 'mw.movie_id', '=', 'movie.id')
            -&gt;join('writers as w', 'w.id', '=', 'mw.writer_id')
            -&gt;join('movie_actors as ma', 'ma.movie_id', '=', 'movie.id')
            -&gt;join('actors as a', 'a.id', '=', 'mw.actor_id')
            -&gt;where('movie.status','=','active')
            -&gt;select('movie.id', 'movie.name')
            -&gt;where($k, 'like', "%$v%")
            -&gt;distinct();
    }
}


With this in place, getBy will return a Query Builder object that you can filter by restricted and limit.

$movie = new Movie();
$movies = $movie-&gt;getBy('writers.name', 'Matthew Weiner')
                -&gt;whereNotIn('movie.id', $this-&gt;restricted())
                -&gt;take($limit)
                -&gt;skip($offset)
                -&gt;get();


Then you can take the a step further by pulling this method out into a MovieRepository that implements MovieRepositoryInterface. Check out this Laracasts episode for more on that. It could have a MovieRepository-&gt;restrictedBy(Builder $builder, $restrictedList) that also returns a Builder object.