I created the customer_products table to store the different_price data. Now I trying to return the different_price to show the data. How do I get the data from the customer_products table?
//Product table
public function customers()
{
return $this->belongsToMany('Customer', 'customer_products')->withPivot('different_price');
}
//Customer table
public function products()
{
return $this->belongsToMany('Product', 'customer_products')->withPivot('different_price');
}