That sounds like a classic many to many relation.
And you shouldn't worry id the number of rows in the database increases, the database can handle a lot of them.
I suggest that you read these two posts.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, i have a VehicleModel, FeatureCategoryModel & FeatureModel. These features can be 50+ across all categories. Each vehicle recorded has its features. Now i want to relate these features with the vehicle without bloating the db. I cnt have 50+ records for each vehicle that can make the db big fast.
class VehicleModel{
/**
* Fields list
* [year] Date
* [model_id] BigInt
* [user_id] BigInt // to see
* [price] double
* [condition] string ( new | used)
* [location_id] bigInt
* [description] Text
*/
}
class FeatureCategory{
/**
* Field list
* name
*/
public function features()
}
class FeatureModel{
/**
* Fields list
* [feature_category_id] bigInt
* [name] String
* [surfix] String // ( one that adds to complete [name] eg. 1ltr )
* [data_type] (double, string, boolean)
* [icon] String
*/
}
That sounds like a classic many to many relation.
And you shouldn't worry id the number of rows in the database increases, the database can handle a lot of them.
I suggest that you read these two posts.
Please or to participate in this conversation.