Help me please, with JOINS, learning SQL and joins are painful :(
I have table: categories with column name: Name, ID
I have table: sub_categories with column name: ID
I have table: provider_services with column name: category_id & subcategory_id
When I do in laravel view blade {{$provider->providerServices()->where("status",1)->count()}}
I will receive: 2
It means, that provider, has 2 services with category_id 2, 3 and subcategory_id 4,8
Question: How can I join this data to table categories and grab the category Name using cat_id & subcat_id?
- Category_id 2 is - Painting
- Category_id 3 is - Plumbing
- SubCategory_id is - Aqua
- SubCategory_id 8 is - Test
So, as A result I need to have something: Painting and Aqua, Plumbing and Test
Thank you very much!