Differentiate between GET and POST method in Laravel Controller
<p>I have 2 routes like below,</p>

<pre><code>Route::get('/','MainController@Date');
Route::post('/','MainController@Date');
</code></pre>

<p>or</p>

<pre><code>Route::any('/','MainController@Date');
</code></pre>

<p>When get request is called i will calculate dates and hen post request is called i will get dates from form inputs.</p>

<p>when post method is called in my controler</p>

<pre><code>$date1 = $request-&gt;get ( 'date1' );
$date2 = $request-&gt;get ( 'date2' );
</code></pre>

<p>when get is called</p>

<pre><code>$date1 = will calculate using date function
$date2 = will calculate using date function
</code></pre>

<p>How differentiate both methods get and post, if get i should one set of things and for post another set of things</p>