Support the ongoing development of Laravel.io →
Database Eloquent Views
Last updated 2 years ago.
0

Could you show your "Products" database schema? When I look your code, I see "$product->productCategoryID". If you keep your category name in database, you can use "$product->productCategoryName".

PS: If your Category Name rows name is "productCategoryName", you can use this. But if your Category Name rows name is different than "productCategoryName" you can't use "productCategoryName". You have to use your rows name.

0

TKarahan said:

Could you show your "Products" database schema? When I look your code, I see "$product->productCategoryID". If you keep your category name in database, you can use "$product->productCategoryName".

PS: If your Category Name rows name is "productCategoryName", you can use this. But if your Category Name rows name is different than "productCategoryName" you can't use "productCategoryName". You have to use your rows name.

Man my Products and Categories are different table. I store Category ID in Products Table. Here's my database schema: http://imgur.com/a/4pK6a

0

Sign in to participate in this thread!

Eventy

Your banner here too?

rijans rijans Joined 6 Mar 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.