Can't add data to a table with belongsToMany relationship

Posted In Voyager
  • hour-ly 1 year ago
    I have a relationship setup between the products and subcategory table. The relationship is belongsToMany using a pivot table called 'product_subcategory' which has two columns are 'product_id' and 'subcategory_id'. 
    Then, when i add  new data to product table it show error 'Unknown Column 'product_subcategory.sub_category_id' in 'on clause'.

    I have a relationship setup between the products and subcategory table. The relationship is belongsToMany using a pivot table called 'product_subcategory' which has two columns are 'product_id' and 'subcategory_id'. Then, when i add new data to product table it show error 'Unknown Column 'product_subcategory.sub_category_id' in 'on clause'.

Please login or signup to leave a response.

Login

or Sign Up

Sign Up

or Login
×
Want to create your own SAAS?

I can teach you to create your own Software as a Service. Click here to learn more!

Visit SAAS Adventure!