title: Add a middleware for only one single method in the controller - Laravel
body: <p>There is a middleware called <code>ageCheck</code> and a controller called <code>MyController</code> and it has following methods which is returning views.</p>
  
  <pre><code>index();
  show();
  edit();
  </code></pre>
  
  <p>How can I add a route middleware for only edit method in the <code>MyController</code>?</p>
  
  <p>I tried this, but it doesn't work!</p>
  
  <p>routes.php:</p>
  
  <pre><code>Route::get('/edit', [
    'middleware' =&gt; 'ageCheck',
    'MyController@edit'
  ]);
  </code></pre>