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

Database menus #32

Open
garygreen opened this issue Jul 22, 2015 · 7 comments
Open

Database menus #32

garygreen opened this issue Jul 22, 2015 · 7 comments

Comments

@garygreen
Copy link

Would be cool to add storage mechanism for database menus.

@nWidart
Copy link
Member

nWidart commented Jul 22, 2015

Your menus should come from the database anyway. I store them in a DB and use this package for display purposes.

@garygreen
Copy link
Author

Can you give snippet example of how you serialize to db and create back into menus?

@nWidart
Copy link
Member

nWidart commented Jul 22, 2015

You can see it here: https://github.com/AsgardCms/Menu/blob/develop/Providers/MenuServiceProvider.php#L147 (biggest part of that service provider).

@nWidart
Copy link
Member

nWidart commented Jul 22, 2015

And saving into the db, that's however you prefer, either the powerful nested sets or just the classic parent_id trick.

@garygreen
Copy link
Author

Well that's the point, you have to do this manually in your app. It would be very useful to have this built into the package.

@nWidart
Copy link
Member

nWidart commented Jul 22, 2015

There are other packages to handle this, like baum.
I don't think it should be related, this leaves the freedom to us to choose which method we prefer to save our tree structures in the database.

@garygreen
Copy link
Author

I still think it would be easier if there was a built in way to store in the database in a 'sane' format. Using the lgt rgt tree structure would be fine and suit 99% of users. I feel like you shouldn't need to do this each time you use the menus package, or care about what structure it's stored in. The main thing that matters is the ability to tell it where to store (DB, Config, etc) and ability to pull back the full menu instance. If you need finer control over the database structure, create your own data store.

A few issues back the dev said he was working on database support. Not sure how far he got with it though..

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

2 participants