Laravel - 使用来自ajax请求的链接重定向

I need to redirect users with a link that I should get from an ajax request. What I need is basically just a route for a page:

Route::get('/access', 'SubpagesController@access');

And in that controller I should redirect users to a link that I am supposed to get from the ajax request:

$.ajax({
    url: url ,
    data : { search: 'test' },
    dataType: 'json',

    success : function(json) {

      link = metaArray[0].value;
    }
  })

Since, this will only be a route to which the users will be able to come only if they write the url for it, so there won't be any links on the page for it, I am not able to send any data from the frontend to backend to work with it? I have no idea how can I go about this issue?

$.ajax({
    url: url ,
    data : { search: 'test' },
    dataType: 'json',

    success : function(json) {

        window.location = metaArray[0].value;
    }
})

Just redirect with javascript using window.location.