AT login.blade.phpMethodNotAllowedHttpException在RouteCollection.php行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>
而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]']);
});
我是在laravel更新。我有這個錯誤發生。如何解決和 method =「post」action =「{{url('/ dashboard')}}」> // {{route('login')}} 「{{csrf_field()}}行動領域哪個URL應該傳遞..我的意思是目的地或相同的路徑..我想重定向到儀表板..謝謝:)