Answers for "laavel relation through morph"

PHP
0

laavel relation through morph

// 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);
}
Posted by: Guest on June-02-2020

Browse Popular Code Answers by Language