0
我試圖在login.blade.php從兩個文本框傳遞一些值到的TestController和呼應values.Iam獲得「不允許的方法異常錯誤」我可以「不懂爲什麼,請告訴我錯了我做了什麼.. 流量Login.blade.php - > @的TestController getIndexMethodNotAllowedHttpException在RouteCollection.php
web.php
Route::get('welcome','[email protected]');
Route::get('login','[email protected]');
Route::get('/','[email protected]');
testController.php
class testController extends Controller
{
public function getIndex(Request $request)
{
$email = $request->get('email');
$password = $request->get('password');
echo $email;
}
public function getData(){
$datas = Test::all();
return view('welcome',compact('datas'));
}
public function getLogin()
{
return view('login');
}
}
login.blade.php
{!! Form::open(['Url' => 'welcome']) !!}
{!! Form::label('email','Email') !!}
{!! Form::text('email',null,array('class' => 'form-control', 'placeholder' => 'Email')) !!}
{!! Form::label('password','Pasword')!!}
{!! Form::text('password',null, array('class' => 'form-control', 'placeholder' => 'Password')) !!}
{!! Form::submit('Login',array('class' => 'btn btn-success btn-block','style'=>'margin-top: 20px;'))!!}
{!! Form::close() !!}