I have 2 tables Categories & Products:
--------------------------
- categories -
--------------------------
- id | int -
- name | varchar -
- category_id | int -
--------------------------
--------------------------
- products -
--------------------------
- id | int -
- name | varchar -
- category_id | int -
--------------------------
Each category may has a parent category or not, the column category_id refer to it. Each product belongs to a category.
Exp : Cat1 -> cate1.2 -> cat1.3->... -> cat1.x-> pro1
Cat2 -> pro2
I want if I search by cat1 or cate1.2 or ... or cat1.x, I can reach the pro1 without knowing all the categories, and the same for pro2??
I use for this sql or eloquent-laravel.

