laravel中间件中的自定义标头返回NULL

Currently I create custom header in ajax GET request to verify the header in the middleware as describe here.

The problem is when I tried to print out the header value in middleware, it successfully display in ajax success callback but return NULL in print out command! Hence the header value is not captured in middleware class.

Here is the ajax code:

var link = $(this).attr('href');

$.ajax({                                                           
    type: "get",                                                  
    url: link,
    headers: { "custom-header": "xxxxxxxxxxxxxx" },
        success: function(result){
            alert(JSON.stringify(result));
        },
        error: function (error) {
            alert(error);
    }
});

Here is the middleware:

public function handle($request, Closure $next, $guard = null)
{
        $token = $request->header('custom-header'); 
        die(var_dump($token));
}

First result from ajax success callback: enter image description here

After alert pop-out closed: NULL value printed on the screen!

I intend to capture the header value to do further verification. Tried to configured .htaccess file but I think not the problem with that.