I have a Multi-dimensional Array like below
quotation_country_1: ["1", "1", "1"]
quotation_institute_1: ["125", "109", "57"]
quotation_course_1: ["19", "7", "17"]
It has successfully inserted in the database but gives an error for the ajax request "Array to string conversion" So can I get help on how to solve this issue?
public function create_quotation(Request $request)
{
$lead_id = $request->post('selected_lead');
$data = $request->all();
if (count($data['quotation_country_1']) > 0) {
foreach ($data['quotation_country_1'] as $item => $value) {
$data2 = array(
'lead_id' => $lead_id,
'interestd_country_id'=>$data['quotation_country_1'][$item],
'interestd_institute_id'=>$data['quotation_institute_1'][$item],
'interestd_course_id'=>$data['quotation_course_1'][$item],
);
DB::table('starter_application_interested_course_ins')
->insert($data2);
}
}
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3ivFMMq
via IFTTT
Aucun commentaire:
Enregistrer un commentaire