title: How to generate a route using a string type parameter
body: <p>In my controller method, a line is created</p>
  
  <pre><code>public function createImg(Request $request, $id)
  {
      $url = url()-&gt;previous();
      $start = env('APP_URL');
      $path = explode($start , $url)[1];
  
  some code
  
      return view('img', ['path'=&gt;$path, 'param'=&gt;$param]);
  }
  </code></pre>
  
  <p>I need to generate a route </p>
  
  <pre><code>Route::get('/{path}/img/{id}', 'App\Http\Controllers\ImgController@createImg')
  </code></pre>
  
  <p>Is it possible to pass a string to a route? How can I do this?</p>