如何将表行从一个表克隆到另一个我找到了克隆但不知道如何将其插入其他表的方法
我有数据类和产品类,我只想从数据克隆到产品一行
public function getClone($id) {
$item = Data::find($id);
$clone = $item->replicate();
unset($clone['created_at'],$clone['updated_at']);
$product = new Product;
--> what goes here i tried $product->fill($clone); But i get error:
must be of the type array, object given
return Redirect::to('admin/content')
->with('message', 'Clone Created!!');
}