I want to store html table into my database but it is throwing this error
array to string conversion
i'm posting html table from javascript to my php controller
var html = '<table><thead><tr><th>Product Name</th><th>Price</th></tr></thead><tbody><tr><td>Alphabet</td><td>200</td></tr></tbody></table>;
$.ajax({
url:'store',
type:'POST',
data:{table:html},
success:function(data){
console.log(data)
}
});
laravel:posted data to be inserted
Route::post('store',function(){
$toStore = addslashes(['table' => $_POST['table']]);
\App\product_table::create($toStore);
});