Retrieving all morphedByMany relations in Laravel Eloquent
问题 In the Laravel documentation, there is the following example for retrieving morphedByMany relations, which are many-to-many polymorphic relations. Laravel Many to Many polymorphic relations documentation namespace App; use Illuminate\Database\Eloquent\Model; class Tag extends Model { /** * Get all of the posts that are assigned this tag. */ public function posts() { return $this->morphedByMany('App\Post', 'taggable'); } /** * Get all of the videos that are assigned this tag. */ public