title: Laravel making optional route parameter with segment
body: <p>Here i would like to make optional parameter for <code>mobile_number</code> in this defined route:</p>
  <pre class="lang-php prettyprint-override"><code>//Route:
  Route::get('user-register/mobile_number={mobile_number?}', [UserAuthenticationController::class, 'register'])
      -&gt;name('user-register');
  </code></pre>
  <pre class="lang-php prettyprint-override"><code>//UserAuthenticationController:
  public function register (string $mobile_number=''): Renderable
  {
      return view('user::register',compact('mobile_number'));
  }
  </code></pre>
  <p>for opening both of <code>http://localhost/user-auth/user-register</code> and <code>http://localhost/user-auth/user-register/mobile-number=</code> i get <code>404 error</code></p>
  <p>how can i resolve this problem to have optional parameter?</p>