MethodNotAllowedHttpException

MethodNotAllowedHttpException

    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Creative - Bootstrap 3 Responsive Admin Template">
    <meta name="author" content="GeeksLabs">
    <meta name="keyword" content="Creative, Dashboard, Admin, Template, Theme, Bootstrap, Responsive, Retina, Minimal">
    <link rel="shortcut icon" href="img/favicon.png">

    <title>welcome</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-theme.css" rel="stylesheet">
    <link href="css/elegant-icons-style.css" rel="stylesheet" />
    <link href="css/font-awesome.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet" />


</head>

  <body class="login-img3-body">

    <div class="container">

      <form class="login-form" action="{{ route('login') }}">
       {{ csrf_field() }}

        <div class="login-wrap">
            <p class="login-img"><i class="icon_lock_alt"></i></p>
            <div class="input-group">
              <span class="input-group-addon"><i class="icon_profile"></i></span>
              <input type="text" name="Username" class="form-control" placeholder="Username" autofocus>
            </div>
            <div class="input-group">
                <span class="input-group-addon"><i class="icon_key_alt"></i></span>
                <input type="password" name="password" class="form-control" placeholder="Password">
            </div>
            <label class="checkbox">
                <input type="checkbox" value="remember-me"> Remember me
                <span class="pull-right"> <a href="#"> Forgot Password?</a></span>
            </label>
            <button class="btn btn-primary btn-lg btn-block" type="submit">Login</button>
            <button class="btn btn-info btn-lg btn-block" type="submit">Signup</button>
        </div>
      </form>
    <div class="text-right">
            <div class="credits">

                <a href="https://facebook.com/D.prakash.pokhrel/"> Developer::prakash</a>
            </div>
        </div>
    </div>


  </body>
</html>


它是我的刀片文件,但是无法正常工作,我该怎么做呢?当我单击登录底部时,我认为它在action =“ {{route('login')}}上出现问题
哎呀,看起来出事了。
RouteCollection.php第251行中的MethodNotAllowedHttpException:我该如何解决?

最佳答案

您缺少method='post',希望您已在routes.php中正确声明了路由

Route::post('/post-form', 'YourController@saveDataFunction');正确声明路由,如果方法是GET,则将其写为Route::GET,否则可以正常工作。

MethodNotAllowedHttpException显然表示未找到该路线,意味着在您声明不同的集合OR中缺少该路线。

08-08 07:34