I am trying to create a website that will allow you to place items in specific categories. Categories will almost always have at least one category of parents, and I would like to be able to display a “tree” of these categories so that users can navigate categories and articles. Bit category will contain columns id, parent_id, cat_name.
Is there a more efficient way to do this in laravel, rather than looking for top-level categories and then looping around to find all the subcategories in each? Where is the best way to execute logic and what is the best way to pass this information into a view?
If I need more clarification, let me know. As I said, I'm pretty new to laravel and frameworks in general, so I might be missing something obvious.
source
share