I'm trying to seed my table with some data with a belongsTo relationship, but I don't know how I should handle this relationship. Can anybody tell me what a belongsTo relationship should look like with seeding real data?
Seed file
public function run()
{
CarSchema::create([
'type_of_car' => 'small',
'horse_power' => 98,
'brand' => 3 // Want to get the brand of id 3 here
])
}
The result I want is that "brand" is what corresponds to id 3 in the brand table so in the front End I've got the brand as well and not just the id of it.