Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menuable should have a custom Pivot #3

Open
m-triassi opened this issue Oct 24, 2023 · 0 comments
Open

Menuable should have a custom Pivot #3

m-triassi opened this issue Oct 24, 2023 · 0 comments

Comments

@m-triassi
Copy link
Contributor

m-triassi commented Oct 24, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant