I'm trying to send some data to an API service that I am consuming the service route type resource
and I send data to that route. I get the following error:
(1/1) ErrorException
Array to string conversion
in beneficiosController.php (line 69)
at HandleExceptions->handleError(8, 'Array to string conversion', '/Users/user/Desktop/users/app/Http/Controllers/transactionController.php', 69, array('request' => object(Request), 'client' => object(Client), 'data' => array('code' => '2270', 'item_code' => '82', 'user' => '555', 'pack_id' => '52', 'transaction_status' => '1', 'transaction_id' => null)))
I'm using this control
public function transaction(Request $request){
$client = new Client();
$data = [
"code" => $request['code'],
"item_code" => $request['item_code'],
"user" => $request['user'],
"pack_id" => $request['pack_id'],
"transaction_status" => $request['transaction_status'],
"transaction_id" => $request['transactransaction_idtion_status'],
];
$response = $client->get("http://localhost:8000/v1/transaction". $data );
echo $response->getBody();
}
How should I send the url with the $ data?