title: Laravel - How to have multiple post route in web.php
body: <p>I'm trying to build a page with two forms, both are set <code>method=&quot;post&quot;</code>, as well as a submit <code>&lt;button&gt;</code> for each form. The submit action of first form is handled by <code>FirstController</code>, and the second one is handled by <code>SecondController</code>. In the route file <code>web.php</code>, I need to declare two route functions for each submit button, and I want to keep the same url, but there is no way the button will know which post it should call. I saw some solutions about creating jobs to handle each button, but anyway can I tell Laravel which post route to call?</p>
  <p>The skeleton is like this:</p>
  <p>web.php</p>
  <pre><code>Route::post('/', 'FirstController@store');
  
  Route::post('/', 'SecondController@sendEmail');
  </code></pre>
  <p>FirstController.php</p>
  <pre><code>class FirstController extends Controller
  {
      public function store()
      {
          /*
              create a new entry to the data base
          */
      }
  }
  </code></pre>
  <p>SecondController.php</p>
  <pre><code>class SecondController extends Controller
  {
      public function sendEmail()
      {
          Mail::to('recipient@abc.com')-&gt;send(new SampleMail());
      }
  }
  </code></pre>