How to get retuned value from one laravel route into another route

Viewed 4132

How to get value of one route into another

Route::get('/first_url', function () {
   return "Hello this is test";
});

I Tried something like this but not worked.

Route::get('/second_url', function () {
   $other_view = Redirect::to('first_url');
});

I want to get returned value from first_url to variable $other_view in second_url to process and manipulate returned value.

Using Redirect is changing url. Which I dont want to use.

Any Idea ??? Or Am I trying wrong thing to do.

8 Answers
Related