== How to fix it in Laravel

=== Code examples

include::../../common/fix/code-rationale.adoc[]

==== Noncompliant code example

[source,php,diff-id=11,diff-type=noncompliant]
----
Route::get('/router', function () {
    $route = Input::get('route');
    return redirect($route); // Noncompliant
});
----

==== Compliant solution

[source,php,diff-id=11,diff-type=compliant]
----
Route::get('/router', function () {
    $route = Input::get('route');
    return redirect()->route($route);
});
----

include::../../common/fix/how-does-this-work.adoc[]

=== Pitfalls

include::../../common/pitfalls/starts-with.adoc[]
