title: Laravel empty route parameter
body: <p>I have multiple routes which will directed to the same controller and method. I want the second route will have an empty customParams, but the first one will use the custom params. What should i do? Thanks</p>
  <pre><code>Route::get('{customParams?}/{slug}/{registrationCode}/detail', [SubmissionController::class, 'submissionDetail'])-&gt;name('submission.detail');
  
  public function submissionDetail($customParams = '', $slug, $registrationCode)
  {
      //
  }
  </code></pre>
  <p>First route was running perfectly</p>
  <pre><code> &lt;a href=&quot;{{ route('submission.detail', ['customParams' =&gt; 'riwayat-pengajuan', 'slug' =&gt; $cs-&gt;service-&gt;slug, 'registrationCode' =&gt; $cs-&gt;registration_code]) }}&quot; class=&quot;btn btn-primary btn-sm&quot;&gt;Detail&lt;/a&gt;
  </code></pre>
  <p>Second route did not work and produce 404 page</p>
  <pre><code> &lt;a href=&quot;{{ route('submission.detail', ['slug' =&gt; $cd-&gt;service-&gt;slug, 'registrationCode' =&gt; $cd-&gt;registration_code]) }}&quot; class=&quot;btn btn-primary btn-sm&quot;&gt;Detail&lt;/a&gt;
  </code></pre>