2017-05-31 4 views
0

AT login.blade.phpMethodNotAllowedHttpException in RouteCollection.php Linie 251:

<!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" method="post" action="{{ url('/dashboard') }}"> //{{ route('login') }} 
     <input type="hidden" name="_token" value="{{ 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/t.prakash.pokhrel/"> Developer::xxx</a> 
      </div> 
     </div> 
    </div> 
    </body> 
</html> 

Und web.php

Route::get('/' , ['as' => '/' , 'uses'=> '[email protected]']); 
    Route::post('/login', ['as' => 'login', 'uses'=> '[email protected]']); 


    Route::group(['middleware' =>['authen']], function() 
    { 
    Route::get('/dashboard',['as'=>'dashboard', 'uses'=> '[email protected]']); 
    Route::get('/logout' ,['as'=>'logout', 'uses'=> '[email protected]']); 

}); 

ich bin eine neuere Version auf Laravel. Ich habe diesen Fehler passiert. wie zu lösen und method = "post" action = "{{url ('/ dashboard')}}"> // {{route ('login')}} "{{csrf_field()}} .In hier auf Handlungsfeld, das sollte uRL übergeben .. ich mein Ziel oder denselben Weg .. i Armaturenbrett umleiten möge .. danke :)

Antwort

0

Check was ur Route durch die Verwendung

php Handwerker erwartet Route: Liste Befehl im Terminal als nächstes ändern Sie Ihre Formular-Methode zu diesem

Wenn Sie möchten, dass Benutzer auf Dashboard umleiten müssen Sie es tun ur controller`

`class ProfileController extends Controller 
{ 
    //your code here 

public dashbord(){ 

// your code 

    return view("your dashboard view path");  
    } 
2

Try Route benötigen

Zuerst ändern Sie Login Route URL in Form (action = "{{url ('/ login')}}") und nach dem Eintragen einstellen Form in Postlogin-Funktion verwenden Auth und überprüfen E-Mail-Passwort ist korrekt oder nicht.Wenn korrekt als Umleitung URL ist Dashboard.

Verwandte Themen