Any ideas why the session variable is not set with this code ?
public function commitTransaction($cluster,$transId)
{
try {
$response = $this->client->request('PUT', 'https://' . $cluster . '/' . $transId, [
'auth' => ['id', 'pass'],
'proxy' => '',
'verify' => false,
'json' => [
'state' => 'VALIDATING'
]
]);
$res = $response->getBody()->getContents();
session()->put('commit',$res);
//dd($res);
return $res;
}
catch (RequestException $e){
var_dump($e->getResponse()->getBody()->getContents());
}
}
The request
is initiated on my constructor.
Thanks for your help.