0
votes
    <!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>

Its my blade file ,but it cant work properly how can i do it workable ?? i think it problem on action="{{ route('login') }} when i click login bottom it shows Whoops, looks like something went wrong. MethodNotAllowedHttpException in RouteCollection.php line 251: How can i solve this??

2

2 Answers

2
votes

You are missing method='post', I hope you have declared the route correctly in routes.php

Route::post('/post-form', 'YourController@saveDataFunction'); declare the route properly, if the method is GET write it as Route::GET else this would work fine.

MethodNotAllowedHttpException clearly means the route is not found, means it's missing in the collection OR you declared it differently.

0
votes

If you don't specify method attribute GET is assumed. This exception means that Laravel couldnot find the specified route.

Which in your case appears to be that you have declared a post route in your routes/web.php file.

Either, edit your web.php file OR specify a method="post" attribute on your form.