Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laavel relation through morph

// Topic Model

public function users()
{
    return $this->hasManyThrough('AppUser', 'AppSubscriber', 'subscribable_id')->where('subscribable_type', array_search(static::class, Relation::morphMap()) ?: static::class);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laavel #relation #morph
ADD COMMENT
Topic
Name
4+1 =