how to clone table row from one table to another i found way to make a clone but dont know how to insert it in other table
I have Data class and Product class and I want to clone from Data to Product one row only
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!!');
}