Laravel: how to fix error Trying to access array offset on value of type null in laravel

i know this question is asked but my script is different string

$data = array( ‘merchantId’ => $merchantId, ‘qrCode’ => $qrCode, );

next step i call jeson data and api

$json_data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $signed_data = $data; $signed_data[‘sign’] = Encryption::generateSignature($json_data,storage_path().self::MERCHANT_PRIVATE_KEY);

but i am getting this error

public static function validationSignature(string $data, string $key) { $data = json_decode($data, true, 512, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $signature = $data[‘sign’]; // here I get an error on this line when trying to access the array offset on a value of type null

Can someone help me solve this, I never integrate the api so I don’t know this error

From the newest questions tagged laravel-5 – Stack Overflow https://ift.tt/39bsHnSvia IFTTT

NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post