title: Sorry, the page you are looking for could not be found. laravel
body: <p>I am trying to redirect the admin to dashboard page by the following codes but when I enter <code>/dashboard</code>, the browser displays a <code>NotFoundHttpException</code> error page. <br><br>
  <strong>Middleware (AdminCheck.php) :</strong><br></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Middleware;
  
  use Closure;
  
  class AdminCheck
  {
  
      public function handle($request, Closure $next)
      {
          $user = auth()-&gt;authenticate();
  
          if ($user-&gt;role !== 'admin')
          {
              return redirect(route('login'));
          }
  
          return $next($request);
      }
  }
  </code></pre>
  
  <p><strong>Kernel.php (App\Http\Kernel.php) :</strong>  <br></p>
  
  <pre><code>protected $routeMiddleware = [
          ...
          'adminCheck' =&gt; \App\Http\Middleware\AdminCheck::class,
      ];
  </code></pre>
  
  <p><strong>Route (App\routes\web.php) :</strong> <br></p>
  
  <pre><code>Route::get('dashboard', function (){
      // 
  })-&gt;middleware('auth', 'adminCheck');
  </code></pre>
  
  <p><strong>dashboard.php :</strong>  <br></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  use App\Http\Requests;
  
  class dashboard extends Controller
  {
      public function index () 
      {
          return view('dashboard');
      }
  }
  </code></pre>
  
  <p>When I enter <code>http://localhost:8000/dashboard</code> there is an error page displayed that says : <br></p>
  
  <pre><code>Sorry, the page you are looking for could not be found.   
  </code></pre>
  
  <p>I seem so dumb by not being able to fix it. Would you help me find out where my problem is? Thank you so much in advance.</p>