I have very simple 2 tables
1. products (id,name)
2. adjustment (id,product_id,amount)
All tables have foreign keys and models are define as bellow
class Product model have
public function adjustment()
{
return $this->hasMany(Adjustment::class);
}
and class Adjustment model have
public function product()
{
return $this->belongsTo(Product::class);
}
now I want to have query of adjustment model
Adjustment::with('product')->get();
I got result of Adjustment table but not product table. what is wrong I am doing here?