Its been a while since I have worked on a Laravel project and cannot see why this issue is happening.
I have a 'vehicles' table and also a 'customers' table.
In the vehicles table there is a row with a fields 'customer_id' that has the value of 1. There is a also a customer in 'customers' table with the id of 1.
In my Vehicle model I have:
public function customer()
{
return $this->belongsTo('App\Customer');
}
But when returning the data from the query:
$vehicle = Vehicle::find($id);
dd($vehicle);
The relations array is blank.
Where my mistake on this one? No errors, just no data.