Laravel - Relationships - One To Many Polymorphic Model Structure

Next, let's examine the model definitions needed to build this relationship:

    
    morphTo();
        }
    }
    
    class Post extends Model
    {
        /**
         * Get all of the post's comments.
         */
        public function comments()
        {
            return $this->morphMany(Comment::class, 'commentable');
        }
    }
    
    class Video extends Model
    {
        /**
         * Get all of the video's comments.
         */
        public function comments()
        {
            return $this->morphMany(Comment::class, 'commentable');
        }
    }