php - how to convert this Slim Framework code into Laravel 5.2 -
// makes insert 2 tables in db.
$app->post('/create_order', 'authenticate', function() use($app) { // check required params verifyrequiredparams(array('oder_data')); global $user_id; $oder_data = $app->request->post('oder_data'); $db = new dbhandler(); $id_client=$user_id; $response = array(); //parsing json array $json_a=json_decode($oder_data,true); if (!$json_a=="") { $order_type=$json_a["order_type"]; $id_reservation=$json_a["id_reservation"]; $id_order = $db->createorder($id_client, $order_type, $id_reservation); $hh=$json_a['data']; foreach($json_a['data'] $p) { $id_dish=$p['id_dish']; $amount=$p['amount']; $description=$p['description']; $note=$p['note']; $result = $db->insert_order_items($id_order, $id_dish, $amount, $description, $note); } return true;
Comments
Post a Comment