Laravel, categories and subcategories

Published 2 years ago by Kitephx

Hello, For beginning, I have a table that contains post nouveautes then the categories and sub categories.

For example, a number of sub categories able to have several categories and sub categories be able to have multiple categories.

(literature*) -> Reviews -> Folder -> Chronic

(Cinema*) -> Reviews -> Folder -> Chronic

(music*) -> Reviews -> Folder -> Chronic

  • = Categories

I want a post belong to categories and sub categories.

I thought to make a many to many between categories and sub categories and then put a category_id subcategory_id in the post table.

Is this correct and / or optimized?

Please sign in or create an account to participate in this conversation.