Question about subcategories for filtering data. Laravel 11
Hey everyone, I have categories & subcategories (categories have a relation with subcategories, for one category there is many subcategories)
I have a question:
Is it acceptable for a recipe to have a category but no subcategory? What impact does this have? Will this be a bug? Will this interfere with filtration?
Would be gratefull for some advices from your experience
Is it acceptable for a recipe to have a category but no subcategory?
Thats up to you. You have to code it for the solution you want.
I would like to ask you, If the user selects a subcategory, it shows recipes in that subcategory. But what if they select category? Do you show all recipes that are in any of the subcategories for that category?
There's "dependent dropdown" logic here (I am using Livewire for that logic).
If the user selects a category (in the first selector), the subcategories for that category will appear in the Dish Subcategory selector (the second one). However, if the user hasn't selected a category, the subcategory selector will be disabled.
Alternatively, the user can specify a category without specifying a subcategory, and in that case, I'll display all recipes that belong to the chosen category.