FilippoLcr
FilippoLcr

Reputation: 119

Redirect to external url with GET Parameter in Laravel 5

Is there possibility to redirect user to an external URL and pass paramter to it i Laravel 5?

Upvotes: 2

Views: 958

Answers (2)

Alexey Mezenin
Alexey Mezenin

Reputation: 163768

You should use away() method:

return redirect()->away('http://sample.com/url?param=param')

Upvotes: 1

Marcin
Marcin

Reputation: 1494

You can pass values to views:

Route::get('/user/{id}', function () {
   $user = User::find($id);
   return view('user', ['user' => $user]);
}

And then access user in the view:

{{ $user }}

Upvotes: 0

Related Questions