I have a Subscriber Model
// Subscriber Model
id
user_id
subscribable_id
subscribable_type
public function user()
{
return $this->belongsTo(\'App\\U
// Topic Model
public function users()
{
return $this->hasManyThrough('App\User', 'App\Subscriber', 'subscribable_id')->where('subscribable_type', array_search(static::class, Relation::morphMap()) ?: static::class);
}
Polymorphic hasManyThrough relationships are the same as any others, but with an added constraint on the subscribable_type, which can be retrieved from the Relation::morphMap() array, or by using the class name directly.