dimanche 10 janvier 2016

Laravel 5 - session put not working

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.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire