I have a category table like this
id | parentId | category
1 | 0 | sports
2 | 1 | cricket
3 | 2 | batsman
4 | 0 | Cinima
5 | 4 | Bolywood
6 | 5 | Actor
And an item table like this
id | categoryId | item
1 | 3 | Sachin
2 | 6 | Amirkhan
I want to select the item and relate it with its parent categories. for eg i want to print a result as
Sachin(batsman-cricket-sports)
Amirkhan(actor-bollywood-cinima)
I have unlimited number of subcategories and can i select all thse in a single query using php and laravel.(i don't likes to use a third relation table for keeping category-subcategory relationship) Is it possible?