title: Laravel & MySQL schema for menu management
body: <p>im building Laravel app which should have menu management, and i’m trying to find best schema for storing menu items &amp; menu types.</p>
  
  <p>The problem App consist of several modules eg.:</p>
  
  <pre><code>blog
  users
  shop
  </code></pre>
  
  <p>Each module can have different views (pages) eg.:</p>
  
  <pre><code>blog = list of posts in category, specific post page, search page
  users = login page, user profile
  shop = list of products in category, product detail, cart, checkout
  </code></pre>
  
  <p>What im trying to achieve is to have within app admin ability to manage menu items such as: </p>
  
  <pre><code>1 - create new item
  
  2 - choose item type [blog, user, shop]
  
  3 - choose page [eg. if prev selection is blog i can choose from: list of posts in category, specific post page, search page]
  
  4 - select necessary page attributes [eg. if prev. selector was specified post page, then i have to choose particular post from blog]
  </code></pre>
  
  <p>I don't know what’s the best way to store such data within MySQL. I was thinking about having menu items table and morphing them to particular item types, then morphing menu item types to particular pages but it seems like i will have to create lots of tables. Do you guys have better idea?</p>