POST API LARAVEL TO PHP NATIVE
Sisi Laravel function insert(Request $req) { $client = new Client(); $url = 'https://domain.com'; $token = 'token'; $data = [ 'param1' => $req->param1, 'param2' => $req->param2, ]; try { $response = $client->request('POST', $url, [ 'headers' => [ 'Authorization' => "Bearer {$token}", 'Accept' => 'application/json', ], 'form_params' => $data ]); $body = $response->getBody()->getContents(); $respon = json_decode($body, true); if ($respon['status_code'] == 200) { } else { return redirect()->back()->with('warning', $respon['message'])->withInput(); } } catch (\Exception $e) { return redirect()->back()->with('war