Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

morphToMany / morphedByMany ? #5

Description

@willvincent

As far as I can tell this is not already supported...

Can we add the ability to define a pivot table for polymorphic relations?

For the use case of; a single shared list of tags, that can be applied to multiple content types.

ie:

tags:

  • technology
  • science
  • entertainment

content types:

  • blog post
  • video
  • article

multiple blog posts, videos and articles might all be tagged with 'science' but 'science' should only exist as a tag one time, and simply be referenced multiple times as one does with a regular many to many relationship utilizing a pivot table.

I suppose a workaround might be just to make the 'taggable' pivot table an actual model, and then setup 1:many relationships between it and tags, and regular polymorphic relations between taggable and the various content types.

Would be nice to not have to make taggable a model though. Here's an example of how it's done in laravel for reference: https://itsolutionstuff.com/post/laravel-many-to-many-polymorphic-relationship-tutorialexample.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions