spatie/laravel-missing-page-redirector

Handling redirects with query string parameters

amochohan opened this issue · 1 comments

Given I have the url: /myendpoint/somepath?parameter1=abc&parameter2=123, how can I catch this package to redirect to a new endpoint?

I've written this using Laravel's standard routes, with a closure as follows:

Route::get('/myendpoint/somepath', function() {
    return Redirect::to('http://someotherdomain.com/anotherendpoint/somethingelse' .
        '?parameter1=' . Request::get('parameter1') .
        '&parameter2=' . Request::get('parameter2'), 302);
});

You can write your own redirector. You can get the url parameters of the $request method. Not sure but I believe to method to get all parameters is all().