Support the ongoing development of Laravel.io →
posted 9 years ago
Database

Hey guys,

I have a table with products and a table with categories. I don't use the products.id and categories.id because of a API connection. After connecting products and categories, i found out that the many 2 many is based on products.id and categories.id, can i change this to something else like categories.internal_id and products.internal_id? My system is now using the record ID instead of the internal_id:

["query"] "select seoshop_categories.*, seoshop_category_product.category_id as pivot_category_id, seoshop_category_product.product_id as pivot_product_id from seoshop_categories inner join seoshop_category_product on seoshop_categories.id = seoshop_category_product.product_id where seoshop_category_product.category_id in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ["bindings"] array(15) { [0] 1 [1] 2 [2] 3 } ["time"] 0.52 }

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Donny5300 donny5300 Joined 3 May 2014

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.

© 2025 Laravel.io - All rights reserved.