title: middleware for one specific method in controller in Laravel
body: <p>I have middleware <code>Auth</code> that is in <code>App\Http\Middleware\</code></p>
  
  <p>In my kernel i added him like:</p>
  
  <pre><code>protected $routeMiddleware = [
          'auth' =&gt; \Illuminate\Auth\Middleware\Authenticate::class,
          'auth.basic' =&gt; \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
          'bindings' =&gt; \Illuminate\Routing\Middleware\SubstituteBindings::class,
          'can' =&gt; \Illuminate\Auth\Middleware\Authorize::class,
          'guest' =&gt; \App\Http\Middleware\RedirectIfAuthenticated::class,
          'throttle' =&gt; \Illuminate\Routing\Middleware\ThrottleRequests::class,
          'Groups' =&gt; \App\Http\Middleware\Groups::class,
          'Auth' =&gt; \App\Http\Middleware\Auth::class,
      ];
  </code></pre>
  
  <p>This middleware contains</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Middleware;
  
  use Closure;
  
  class Auth
  {
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Closure  $next
       * @return mixed
       */
      public function handle($request, Closure $next)
      {
          if( !auth()-&gt;check() )
          {
              return abort(404);
          }
          return $next($request);
      }
  }
  </code></pre>
  
  <p>And in my controller method I use</p>
  
  <p><code>$this-&gt;middleware('Auth');</code></p>
  
  <p>But this doesn't work at all.</p>
  
  <p>And when I take my <code>'Auth' =&gt; \App\Http\Middleware\Auth::class,</code> and place it into <code>protected $middlewareGroups</code> like <code>\App\Http\Middleware\Auth::class,</code> it works. But for every single page. So when I am not logged it all time abort404.</p>
  
  <p>What is wrong here?
  I can't see, it looks fine to me.</p>
  
  <p>But this middleware doesn't work for this method in which I have <code>$this-&gt;middleware('Auth');</code></p>
  
  <p>I am not logged in but page appears as normal.</p>
  
  <p>And there should be abort404 fired cuz I am not logged</p>
  
  <p>What made I wrong?</p>