title: Laravel 5.4: call a route function from controller with parameters
body: <p>I want to call a route function from my controller with some parameters. </p>
  
  <p>This is my Controller</p>
  
  <pre><code>public function myFunction($id, $name)
  {
      $id = 1;
      $name = 'john';
  
      return redirect()-&gt;route('details/' . $id . '/' . $name);
  }
  </code></pre>
  
  <p>This is my route</p>
  
  <pre><code>Route::get('details/{id}/{name}',['uses' =&gt;'My_controller@myFunction']);
  </code></pre>
  
  <p>This is the error I get when I run the script.</p>
  
  <pre><code>InvalidArgumentException in UrlGenerator.php line 304:
  
  Route [details/1/john] not defined.
  </code></pre>
  
  <p>Please Help</p>