Giter Club home page Giter Club logo

Comments (7)

nWidart avatar nWidart commented on July 17, 2024

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

from menus.

garygreen avatar garygreen commented on July 17, 2024

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

from menus.

nWidart avatar nWidart commented on July 17, 2024

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

from menus.

nWidart avatar nWidart commented on July 17, 2024

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

from menus.

garygreen avatar garygreen commented on July 17, 2024

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.

from menus.

nWidart avatar nWidart commented on July 17, 2024

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.

from menus.

garygreen avatar garygreen commented on July 17, 2024

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..

from menus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.