假设我有三个表,关系如下:
然而我还想插入到选项值中。
我尝试过。
但是这并不起作用。如何使用Eloquent ORM实现呢?
product
has many options
option
can belong to many product has option_values
option_value
belongs to many option
product->options()->insert($stuff);
然而我还想插入到选项值中。
我尝试过。
product->options()->values()->insert($otherStuff);
但是这并不起作用。如何使用Eloquent ORM实现呢?