getHeaderLine('App-Signature'); // Load the server's expected signature from the .env $validSignature = getenv('APP_SIGNATURE'); // Check if signature is valid if ($clientSignature !== $validSignature) { return service('response') ->setStatusCode(403) ->setJSON([ 'status' => false, 'message' => 'Forbidden: Invalid App Signature', ]); } // allow request to proceed } public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) { // nothing to do after response } }