Skip to content

Menuable should have a custom Pivot #3

Description

@m-triassi

Description

It could be useful to define a pivot model for the menuable table to allow easy traversal between linkables and menus

Potential Enhancement:

What if we renamed this to navs (or something else) and made it a custom morph pivot like Nav, so you can at least go backward from a menu to the things that reference it.

Ie: $menu->navs->first()->menuable

Otherwise you get forced into knowing in advance the Content types it links to in order to do something like $menu->pages.

If Menu instances dont need to be linked to multiple pieces of Menuable content/objects, then we could always just put the menuable morphs on the menus table.

Originally posted by @kfriars in #2 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions